configalchemy package

BaseConfig module

class configalchemy.BaseConfig[source]

Initialize the BaseConfig with the Priority:

configure from env > configure from local file > configure from function > default configuration

Example of class-based configuration:

class DefaultConfig(BaseConfig):
    TEST = "test"

config = DefaultConfig()
CONFIGALCHEMY_ENABLE_FUNCTION = False

set to True if you want to override config from function return value.

CONFIGALCHEMY_ENV_PREFIX = ''

The prefix to construct the full environment variable key to access overrode config.

CONFIGALCHEMY_LOAD_FILE_SILENT = False

set to True if you want silent failure for missing files.

CONFIGALCHEMY_ROOT_PATH = ''

The the filename of the JSON file. This can either be an absolute filename or a filename relative to the CONFIGALCHEMY_ROOT_PATH.

CONFIGALCHEMY_SETITEM_PRIORITY = 99

The priority of config[‘TEST’] = value, config.TEST = value and config.update(TEST=value)

access_config_from_coroutine(priority: int) → bool[source]

Async updates the values in the config from the configuration_function.

access_config_from_function(priority: int) → bool[source]

Updates the values in the config from the configuration_function.

from_mapping(*mappings, priority: int) → bool[source]

Updates the config like update() ignoring items with non-upper keys.

ApolloBaseConfig module

class configalchemy.contrib.apollo.ApolloBaseConfig[source]