Configuration
Classes:
|
Configuration settings for the EarthOne client. |
Functions:
An alias for |
|
|
An alias for |
|
An alias for |
Data:
Standard AWS environment |
- class Settings(wrapped=None, **kwargs)[source]
Configuration settings for the EarthOne client.
Based on the
Dynaconfpackage. This settings class supports configuration from named “environments” in asettings.tomlfile as well as environment variables with names that are prefixed withEARTHONE_(or the prefix specified in theenvvar_prefix).For the full capabilities of
Dynaconfplease consult https://www.dynaconf.com/.Note that normally
Settingsfunctions entirely automatically within the client. However, it is possible to perform custom initialization programmatically. In order to do this, the beginning of the client program must execute code like this:from earthdaily.earthone.config import Settings Settings.select_env(...)
Before importing or otherwise accessing anything else within the
earthdaily-earthonepackage.handle initialization for the customization cases
- Parameters:
wrapped – a deepcopy of this object will be wrapped (issue #596)
kwargs – values that overrides default_settings
Methods:
Configure and retrieve the current or default settings for the client.
peek_settings([env, settings_file, ...])Retrieve the settings without configuring the client.
select_env([env, settings_file, envvar_prefix])Configure the EarthOne client.
Attributes:
The current client configuration name or None of no environment was selected.
- classmethod get_settings()[source]
Configure and retrieve the current or default settings for the client.
- Returns:
Returns a
Settingsinstance, a dict-like object containing the configured settings for the client.- Return type:
- Raises:
ConfigError – If no client configuration could be established, or if an invalid configuration name was specified, or if you try to change the client configuration after the client is already configured.
- classmethod peek_settings(env=None, settings_file=None, envvar_prefix='EARTHONE')[source]
Retrieve the settings without configuring the client.
Unlike
get_settings()andselect_env()which both will configure the client, thepeek_settings()will not configure the client andSettings.envwill not be set.See
select_env()for an explanation of the parameters, return value, and exceptions that can be raised.
- classmethod select_env(env=None, settings_file=None, envvar_prefix='EARTHONE')[source]
Configure the EarthOne client.
- Parameters:
env (str, optional) – Name of the environment to configure. Must appear in
earthdaily.earthone/config/settings.tomlIf not supplied will be determined from the EARTHONE_ENV environment variable (or use the prefix specified in the envvar_prefix`_ENV), if set. Otherwise defaults to `production.settings_file (str, optional) – If supplied, will be consulted for additional configuration overrides. These are applied over those in the
earthdaily.earthone/config/settings.tomlfile, but are themselves overwritten by any environment variable settings matching the envvar_prefix.envvar_prefix (str, optional) – Prefix for environment variable names to consult for configuration overrides. Environment variables with a leading prefix of
"<envvar_prefix>_"will override the settings in the resulting configuration after the settings file(s) have been consulted.
- Returns:
Returns a
Settingsinstance, a dict-like object containing the configured settings for the client.- Return type:
- Raises:
ConfigError – If no client configuration could be established, or if an invalid configuration name was specified, or if you try to change the client configuration after the client is already configured.
- env = 'production'
The current client configuration name or None of no environment was selected.
- Type:
str
- get_settings()
An alias for
Settings.get_settings()
- peek_settings(env=None, settings_file=None, envvar_prefix='EARTHONE')
An alias for
Settings.peek_settings()
- select_env(env=None, settings_file=None, envvar_prefix='EARTHONE')
An alias for
Settings.select_env()
- DEFAULT_ENVIRONMENT = 'production'
Standard AWS environment