cfitall.providers.environment.EnvironmentProvider¶
- class EnvironmentProvider(prefix, cast_bool=True, level_separator='__', provider_name='environment', value_separator=',', value_split=True)¶
Bases:
cfitall.providers.base.ConfigProviderBase
EnvironmentProvider attempts to read configuration values from environment variables.
- Parameters
prefix (
str
) – namespace prefix for environment variables (e.g. “myapp”)cast_bool (
bool
) – attempt to cast “true” and “false” strings as booleans (True)level_separator (
str
) – hierarchical separator in env variable name (“__”)provider_name (
str
) – friendly name for the provider (“environment”)value_separator (
str
) – string or regex to split lists on (“,”)value_split (
bool
) – whether to split values enclosed in square brackets (True)
Methods
This is a no-op for the EnvironmentProvider, which always reads environment variables in realtime as doing so is a non-blocking call.
Attributes
Returns the provider's configuration data from environment variables.
provider_name
each provider must provide a unique provider_name
whether to cast "true" and "false" strings to boolean values
string used to separate dictionary keys in variable names
namespace for parsing variable names
character used to separate delimited values
whether to split values on value_separator
- property dict: dict¶
Returns the provider’s configuration data from environment variables.
- Return type
- update()¶
This is a no-op for the EnvironmentProvider, which always reads environment variables in realtime as doing so is a non-blocking call.
- Return type