pydantic-settings
pydantic-settings copied to clipboard
Settings management using pydantic
Hi, I'd like to inquire about the intentionality of this dotenv loading behavior when `env_prefix` is set. Namely, even with an `env_prefix` set in the model config, it looks like...
### Checks * [x] I added a descriptive title to this issue * [x] I have searched (google, github) for similar issues and couldn't find anything * [x] I have...
``` if not env_used: if is_extra_allowed and env_name.startswith(self.env_prefix): # env_prefix should be respected and removed from the env_name normalized_env_name = env_name[len(self.env_prefix) :] data[normalized_env_name] = env_value else: data[env_name] = env_value ```...
Resolves #209. This PR implements a `CliSettingsSource` with the following main features outlined below. Refer to [docs/index.md](https://github.com/pydantic/pydantic-settings/pull/214/files#diff-b4d68dc855d0f9476d3f2ee343853bd21bf82ea9960d0cf06661baa244439dd6R462) for more details. ## Current Examples ### Fields * Same expectations as setting...
Currently pydantic-settings determines whether a field is "complex" (nested) or not based on its annotation as follows: ```py def _annotation_is_complex_inner(annotation: type[Any] | None) -> bool: if lenient_issubclass(annotation, (str, bytes)): return...
After making a [discussion](https://github.com/pydantic/pydantic/discussions/8293), [question](https://stackoverflow.com/questions/77600871/use-rootmodel-as-basesettings), and not getting any answers, I assume the functionality I'm looking for is not implemented, so I am making a feature request. --- I want...
Hi, I was using the dotenv related settings in pydantic BaseSettings and found something weird. Nested 'BaseModel' is used for 'BaseSettings', and the alias of the inner model operate dependently...
I would like to override the defaulted config file path used in a file settings source. In the example below the default yaml file that is read in is `/etc/config.yaml`...
I used a `customise_sources` in pydantic V1 to pass a custom config file and recently discovered that this no longer works under pydantic V2. ### MWE pydantic V1 In pydantic...
This ``.envs`` file: ```` TESTING=TRUE CONNECTION_ADDRESS="example.com" CONNECTION_PORT=443 ```` worked in Pydantic Settings 2.1 with this python code without problems: ````Python from pydantic_settings import BaseSettings, SettingsConfigDict class ConnectionSettings(BaseSettings): model_config = SettingsConfigDict(env_prefix='connection_',...