Io
schemas.io.YamlIO
¶
Bases: ABC
Handles YAML inputs and outputs.
from_yaml(yaml_paths)
¶
Update the instance's attributes from one or more YAML files.
TODO: Need to fix with new Pydantic framework.
PARAMETER | DESCRIPTION |
---|---|
yaml_paths |
A sequence of YAML file paths or a single YAML file path.
TYPE:
|
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.
TODO: Need to fix with new Pydantic framework.
PARAMETER | DESCRIPTION |
---|---|
file_path |
Path to the YAML file to write the serialized data to.
TYPE:
|
RAISES | DESCRIPTION |
---|---|
YamlIOError
|
If the file cannot be written to. |
update(data)
¶
Iteratively update pydantic model.
PARAMETER | DESCRIPTION |
---|---|
data |
Key-value mapping to update attributes with.
TYPE:
|