BaseConfig#

class openstef_core.base_model.BaseConfig[source]#

Bases: BaseModel

Base configuration model.

It configures Pydantic model for safe YAML serialization / deserialization.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': False, 'extra': 'ignore', 'protected_namespaces': ()}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

classmethod read_yaml(path: Path) → Self[source]#

Create an instance from a YAML file.

Parameters:

path (Path) – Path to the YAML file to read.

Return type:

Self

Returns:

An instance of the config class populated with the file contents.

write_yaml(path: Path) → None[source]#

Write this configuration to a YAML file.

Parameters:

path (Path) – Destination path for the YAML file (will be overwritten).

Return type:

None