conflog.loaders package

Submodules

conflog.loaders.environ_loader module

Environment variable configuration loader for conflog.

conflog.loaders.environ_loader.load() dict[source]

Load configuration values from environment variables.

Each parameter in PARAMS is looked up as CONFLOG_<PARAM> (upper-cased). Only variables that are set are included in the result.

Returns:

Dict of configuration parameters found in the environment.

Return type:

dict

conflog.loaders.ini_loader module

INI file configuration loader for conflog.

conflog.loaders.ini_loader.load(conf_file: str) dict[source]

Load configuration values from an INI file.

Reads the [conflog] section and returns only the keys listed in PARAMS.

Parameters:

conf_file (str) – Path to the INI configuration file.

Returns:

Dict of configuration parameters found in the file.

Return type:

dict

conflog.loaders.json_loader module

JSON file configuration loader for conflog.

conflog.loaders.json_loader.load(conf_file: str) dict[source]

Load configuration values from a JSON file.

Returns only the top-level keys listed in PARAMS.

Parameters:

conf_file (str) – Path to the JSON configuration file.

Returns:

Dict of configuration parameters found in the file.

Return type:

dict

conflog.loaders.xml_loader module

XML file configuration loader for conflog.

conflog.loaders.xml_loader.load(conf_file: str) dict[source]

Load configuration values from an XML file.

Matches direct child elements of the root node against PARAMS and returns their text content.

Parameters:

conf_file (str) – Path to the XML configuration file.

Returns:

Dict of configuration parameters found in the file.

Return type:

dict

conflog.loaders.yaml_loader module

YAML file configuration loader for conflog.

conflog.loaders.yaml_loader.load(conf_file: str) dict[source]

Load configuration values from a YAML file.

Returns only the top-level keys listed in PARAMS. An empty YAML document returns an empty dict without error.

Parameters:

conf_file (str) – Path to the YAML configuration file.

Returns:

Dict of configuration parameters found in the file.

Return type:

dict

Module contents

Configuration loaders for INI, JSON, XML, YAML, and environment variables.

conflog.loaders.PARAMS = ['handlers', 'datefmt', 'filename', 'filemode', 'format', 'level', 'extras']

list[str]: Names of all recognised conflog configuration parameters.