-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request
Milestone
Description
Summary
- As raised by @ericchansen in required field marked as optional #34,
pydantic-argparseshould be able to piggy-back offpydanticand support loading environment variables from.envfiles. - This can probably be accomplished by defining arguments as shown below:
class Args(pydantic.BaseSettings): my_arg: int = pydantic.Field(description="this is an int") class Config: env_file = ".env" env_file_encoding = "utf-8"
- See: https://docs.pydantic.dev/latest/usage/settings/#dotenv-env-support
- If this does work, it might be nice to provide a
dotenvextra forpydantic-argparse(similar topydantic) so people can install it with:$ pip install pydantic-argparse[dotenv]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request