calliope.config
¶
Module Contents¶
Classes¶
Helper to read configuration values from well-known config file. |
- class calliope.config.Configuration¶
Helper to read configuration values from well-known config file.
The config file location is determined by the
XDG_CONFIG_HOME
environment variable, usually resolving to$HOME/.local/calliope/calliope.conf
.- get(section, name)¶
Read a single config value.
Config key names should be lowercase and use underscore (
_
) to separate words. For backwards compatibility reasons, if a keyfoo_bar
is not found in the config,foo-bar
will also be checked.- Parameters:
section (str) –
name (str) –
- Return type:
any
- get_section(section)¶
Return all key/value pairs defined in
section
.Any hyphens (
-
) in key names will be converted to underscores (_
).- Parameters:
section (str) –
- Return type:
Dict[str, any]