core.configuration ================== .. py:module:: core.configuration .. autoapi-nested-parse:: Parse configuration options and set them to be used throughout the Jobmon Architecture. Attributes ---------- .. autoapisummary:: core.configuration.DEFAULTS_FILE_NAME core.configuration.DEFAULTS_FILE core.configuration.ENV_VAR_PREFIX Classes ------- .. autoapisummary:: core.configuration.JobmonConfig core.configuration.ConfigCLI Functions --------- .. autoapisummary:: core.configuration.main Module Contents --------------- .. py:data:: DEFAULTS_FILE_NAME :value: 'defaults.yaml' .. py:data:: DEFAULTS_FILE .. py:data:: ENV_VAR_PREFIX :value: 'JOBMON__' .. py:class:: JobmonConfig(filepath: str = '', dict_config: Optional[Dict] = None) Default config setup using YAML. .. py:attribute:: _dict_config :value: None .. py:method:: _merge_dicts(base: Dict, override: Dict) -> Dict Utility function to merge two dictionaries. .. py:method:: _get_env_var_name(section: str, key: str) -> str .. py:method:: _get_environment_variable(section: str, key: str) -> Optional[str] .. py:method:: _interpolate_env_vars(value: Any) -> Any .. py:method:: _coerce_value(value: Any) -> Any 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 .. py:method:: _get_yaml_variable(section: str, key: str) -> Optional[str] .. py:method:: _get_dict_config_variable(section: str, key: str) -> Optional[str] .. py:method:: _wrapped_get(section: str, key: str) -> str .. py:method:: get(section: str, key: str) -> str Get the configuration value for the section and key. Raise if key not found. :param section: the section of the yaml to search. :param key: the key within the section to retrieve Raises: ConfigError .. py:method:: get_section(section: str) -> Dict[str, Any] Returns a dictionary of all key-value pairs in the given section. The order of precedence: dict_config > Environment Variable > YAML File. .. py:method:: get_section_coerced(section: str) -> Dict[str, Any] 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 .. py:method:: get_boolean(section: str, key: str) -> bool Get the configuration value for the section and key as bool. Raise if key not found. .. py:method:: get_int(section: str, key: str) -> int Get the configuration value for the section and key as int. Raise if key not found. .. py:method:: get_float(section: str, key: str) -> float Get the configuration value for the section/key as float. Raise if key not found. .. py:method:: set(section: str, key: str, val: str) -> None Set the configuration value for the section/key. .. py:method:: write(filepath: Union[str, pathlib.Path] = '') -> None Persist the current config to disk. .. py:class:: ConfigCLI Bases: :py:obj:`jobmon.core.cli.CLI` CLI for `jobmon_config. .. py:attribute:: _subparsers .. py:function:: main(argstr: Optional[str] = None) -> None Create CLI.