cowbird.config
Module Contents
Functions
|
Loads a file path or dictionary as YAML/JSON configuration. |
|
Loads all configuration files specified by the path (if a directory), |
|
Applies environment variable expansion recursively to all applicable fields of a configuration definition. |
Attributes
-
exception
cowbird.config.
ConfigError
[source] Bases:
RuntimeError
Generic error during configuration loading.
Initialize self. See help(type(self)) for accurate signature.
-
cowbird.config.
_load_config
(path_or_dict: Union[str, cowbird.typedefs.ConfigDict], section: str, allow_missing: bool = False) → cowbird.typedefs.ConfigDict[source] Loads a file path or dictionary as YAML/JSON configuration.
-
cowbird.config.
get_all_configs
(path_or_dict: Union[str, cowbird.typedefs.ConfigDict], section: str, allow_missing: bool = False) → List[cowbird.typedefs.ConfigDict][source] Loads all configuration files specified by the path (if a directory), a single configuration (if a file) or directly returns the specified dictionary section (if a configuration dictionary). :returns:
list of configurations loaded if input was a directory path
list of single configuration if input was a file path
list of single configuration if input was a JSON dict
empty list if none of the other cases where matched
Note
Order of file loading will be resolved by alphabetically sorted filename if specifying a directory path.