Skip to content

Io

YamlIO

from_yaml(yaml_paths)

Update the instance's attributes from one or more YAML files.

PARAMETER DESCRIPTION
yaml_paths

A sequence of YAML file paths or a single YAML file path.

TYPE: str | Sequence[str]

RAISES DESCRIPTION
FileNotFoundError

If any of the YAML files cannot be found.

to_yaml(file_path)

Serialize a Pydantic BaseModel instance to a YAML file.

PARAMETER DESCRIPTION
file_path

Path to the YAML file to write the serialized data to.

TYPE: str

RAISES DESCRIPTION
IOError

If the file cannot be written to.