Setting and getting configuration values

Setting and getting configuration values#

This module provides getter and setter functions to set and get the value of configuration options, respectively.

vortex.config.from_config(section, key=None)[source]#

Retrieve a configuration key value for a given section.

If key is None, the whole section is returned as a dictionary.

vortex.config.is_defined(section, key=None)[source]#

Return whether or not the key is defined for the section.

If key is None, return whether or not the section exists in the current configuration.

vortex.config.load_config(configpath=PosixPath('vortex.toml'))[source]#

Load configuration from a TOML configuration file

Existing configuration values are overriden. The configuration is expected to have valid TOML syntax, e.g.

[data-tree]
op_rootdir = "/chaine/mxpt001"

[storage]
address = "hendrix.meteo.fr"
protocol = "ftp"
# ...
vortex.config.print_config()[source]#

Print configuration (key, value) pairs

vortex.config.set_config(section, key, value)[source]#

Set a configuration key to a value