preheat_open.configuration.ConfigLoader

class preheat_open.configuration.ConfigLoader(data=None, path=None, force_reload=True)

Bases: object

Loads configuration from YAML and sets environment variables.

Responsible for loading configuration data from a YAML file and setting the corresponding environment variables that will be used by configuration classes.

This loader automatically adapts to any ConfigBase subclasses in the system.

__init__(data=None, path=None, force_reload=True)

Initialize the config loader.

Args:

default_config_path (str): Path to the default configuration file

Methods

__init__([data, path, force_reload])

Initialize the config loader.

find_config_path()

Find the first available configuration directory and its config file.

load_config_file([path])

Load configuration from a YAML file.

find_config_path()

Find the first available configuration directory and its config file.

Searches first in private paths, then falls back to public paths.

Return type:

Optional[str]

Returns:

str: Path to the configuration file

load_config_file(path=None)

Load configuration from a YAML file.

Return type:

None

Args:
file_path (Optional[Union[str, Path]]): Path to configuration file.

If None, the default path will be used.

Raises:

FileNotFoundError: If the configuration file doesn’t exist