raplan.yaml
¶
RaPlan input/output module
from_yaml
¶
Load any supported object from a YAML file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cls
|
type[T]
|
Class or type of object to import. |
required |
path
|
str | Path
|
Path to the YAML file. |
required |
Returns:
| Type | Description |
|---|---|
T
|
An instance of type |
Note
If you wish to import from a YAML string instead, see raplan.io.from_yaml, which is an
alias of the excellent serde.yaml.from_yaml
Source code in src/raplan/yaml.py
to_yaml
¶
Save an object to a YAML file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obj
|
Any
|
Any object from the |
required |
path
|
str | Path | None
|
Path to YAML file to export to. |
None
|
Note
If you wish to serialize to a YAML string instead, see raplan.io.to_yaml, which is an
alias of the excellent serde.yaml.to_yaml.