tokio.config module

Loads the pytokio configuration file.

The pytokio configuration file can be either a JSON or YAML file that contains various site-specific constants, paths, and defaults. pytokio should import correctly and all connectors should be functional in the absence of a configuration file.

If the PyYAML package is available, the configuration file may reference environment variables which get correctly resolved during import. This requires that the configuration file only reference $VARIABLES in unquoted strings; quoted strings (such as those when loading JSON-formatted YAML) will not be expanded.

A subset of configuration parameters can be overridden by environment variables prefixed with PYTOKIO_.

tokio.config.CONFIG = {}

Global variable containing the configuration

tokio.config.DEFAULT_CONFIG_FILE = ''

Path of default site configuration file


Config parameters that can be overridden using PYTOKIO_* environment variable

tokio.config.PYTOKIO_CONFIG_FILE = ''

Path to configuration file to load


Loads the global configuration.

Loads the site-wide configuration file, then inspects relevant environment variables for overrides.


Loads YAML config file and expands all environment variables contained therein

Parameters:file_handle (file) – File containing YAML to load