Skip to content

isimip_utils.config

Configuration management for ISIMIP tools.

Settings

Singleton settings class for managing application configuration.

This class provides a centralized settings store that combines input from argparse, environment variables, and config files. Settings are stored as uppercase keys and can be accessed as attributes.

to_dict()

Return the settings as a dictionary.

Returns:

Type Description
dict[str, Any]

Dictionary of all settings.

from_dict(values) classmethod

Create a Settings instance from a dictionary.

Parameters:

Name Type Description Default
values dict[str, Any]

Dictionary of setting key-value pairs.

required

Returns:

Type Description
Settings

A Settings instance populated with the provided values.

Settings

All keys are converted to uppercase.

from_toml(path, section=None) classmethod

Create a Settings instance from a TOML file.

Parameters:

Name Type Description Default
path Path

Path to the TOML file.

required
section str

Section to use.

None

Returns:

Type Description
Settings

A Settings instance populated with the content of the TOML file.

Settings

All keys are converted to uppercase.