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. Jobmon config class. :param filepath: where to read defaults from. :param dict_config: Dictionary of values to override. Config file priority: 1. user specified file passed in 2. environment variable ``JOBMON__CONFIG_FILE`` (backdoor for testing) 3. config file from installer 4. default config file in core .. 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`` command. Initialization of client CLI. .. py:function:: main(argstr: Optional[str] = None) -> None Create CLI.