vak.config.parse.from_toml#

vak.config.parse.from_toml(config_toml, toml_path=None, sections=None)[source]#

load a TOML configuration file

Parameters:
  • config_toml (dict) – Python dict containing a .toml configuration file, parsed by the toml library.

  • toml_path (str, Path) – path to a configuration file in TOML format. Default is None. Not required, used only to make any error messages clearer.

  • sections (str, list) – name of section or sections from configuration file that should be parsed. Can be a string (single section) or list of strings (multiple sections). Default is None, in which case all are validated and parsed.

Returns:

config – instance of Config class, whose attributes correspond to sections in a config.toml file.

Return type:

vak.config.parse.Config