Configuration

Data:

AWS_ENVIRONMENT

str(object=’‘) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

GCP_ENVIRONMENT

str(object=’‘) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Classes:

Settings(**kwargs)

Configuration settings for the descarteslabs client.

Functions:

get_settings()

Retrieve the current Settings for the client.

select_env([env, settings_file, …])

Configure the descarteslabs client.

class Settings(**kwargs)[source]

Configuration settings for the descarteslabs client.

Based on the dynaconf package. This settings class supports configuration from named “environments” in a settings.toml file as well as environment variables with names that are prefixed with DESCARTESLABS_ (or whatever was specified in the envvar_prefix).

For the full capabilities of dynaconf please consult https://www.dynaconf.com/.

Note that normally Settings functions 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 descarteslabs.config import Settings Settings.select_env(...) ` before importing or otherwise accessing anything else within the descarteslabs package.

handle initialization for the customization cases

Parameters

kwargs – values that overrides default_settings

Methods:

get_settings()

Retrieve the current Settings for the client.

select_env([env, settings_file, …])

Configure the descarteslabs client.

classmethod get_settings()[source]

Retrieve the current Settings for the client.

classmethod select_env(env=None, settings_file=None, envvar_prefix='DESCARTESLABS', auth=None)[source]

Configure the descarteslabs client.

Parameters
  • env (str, optional) – Name of the environment to configure. Must appear in descarteslabs/config/settings.toml If not supplied will be determined from the DESCARTESLABS_ENV environment variable (or whatever was specified in the `envvar_prefix`_ENV), if set, otherwise from the user’s authenticated permissions.

  • settings_file (str, optional) – If supplied, will be consulted for additional configuration overrides. These are applied over those in the descarteslabs/config/settings.toml file, 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.

  • auth (Auth, optional) – If env is not supplied, then consult the user’s authenticated permissions using this Auth instance. If not supplied, then a default Auth instance is constructed.

Returns

  • Returns a Settings object, essentially a glorified dict-like object

  • containing the configured settings for the client.

get_settings()

Retrieve the current Settings for the client.

select_env(env=None, settings_file=None, envvar_prefix='DESCARTESLABS', auth=None)

Configure the descarteslabs client.

Parameters
  • env (str, optional) – Name of the environment to configure. Must appear in descarteslabs/config/settings.toml If not supplied will be determined from the DESCARTESLABS_ENV environment variable (or whatever was specified in the `envvar_prefix`_ENV), if set, otherwise from the user’s authenticated permissions.

  • settings_file (str, optional) – If supplied, will be consulted for additional configuration overrides. These are applied over those in the descarteslabs/config/settings.toml file, 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.

  • auth (Auth, optional) – If env is not supplied, then consult the user’s authenticated permissions using this Auth instance. If not supplied, then a default Auth instance is constructed.

Returns

  • Returns a Settings object, essentially a glorified dict-like object

  • containing the configured settings for the client.

AWS_ENVIRONMENT = 'aws-production'

Standard AWS environment

GCP_ENVIRONMENT = 'gcp-production'

Standard GCP environment