core.configuration
Parse configuration options and set them to be used throughout the Jobmon Architecture.
Attributes
Classes
Default config setup using YAML. |
|
CLI for `jobmon_config. |
Functions
|
Create CLI. |
Module Contents
- class core.configuration.JobmonConfig(filepath: str = '', dict_config: Dict | None = None)[source]
Default config setup using YAML.
- _coerce_value(value: Any) Any[source]
Recursively coerce values to appropriate Python types.
‘true’, ‘false’, etc. → bool
Numeric strings → int/float
JSON / Python literals → parsed objects
Dict / list containers → recurse element-wise
Anything else → returned unchanged
- get(section: str, key: str) str[source]
Get the configuration value for the section and key. Raise if key not found.
- Parameters:
section – the section of the yaml to search.
key – the key within the section to retrieve
Raises: ConfigError
- get_section(section: str) Dict[str, Any][source]
Returns a dictionary of all key-value pairs in the given section.
The order of precedence: dict_config > Environment Variable > YAML File.
- get_section_coerced(section: str) Dict[str, Any][source]
Returns a dictionary with all values coerced to appropriate Python types.
Same as get_section() but automatically converts: - String booleans to bool - Numeric strings to int/float - JSON/Python literals to their parsed values - Nested structures recursively
- get_boolean(section: str, key: str) bool[source]
Get the configuration value for the section and key as bool.
Raise if key not found.
- get_int(section: str, key: str) int[source]
Get the configuration value for the section and key as int.
Raise if key not found.
- get_float(section: str, key: str) float[source]
Get the configuration value for the section/key as float. Raise if key not found.
- set(section: str, key: str, val: str) None[source]
Set the configuration value for the section/key.
- write(filepath: str | pathlib.Path = '') None[source]
Persist the current config to disk.