BaseConfig#

class openstef_core.base_model.BaseConfig(**data: Any) None[source]#

Bases: BaseModel

Base configuration model.

It configures Pydantic model for safe YAML serialization / deserialization.

Parameters:

data (Any)

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.

  • path

Returns:

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

Return type:

Self

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).

  • path

Return type:

None