yaml¶
YAML I/O module.
Classes
Safe YAML reader. |
|
Safe YAML writer. |
- class YAMLReader[source]¶
Bases:
object
Safe YAML reader.
- class YAMLWriter[source]¶
Bases:
object
Safe YAML writer.
- static check(path, overwrite=False)[source]¶
Checks that a file has the correct extension and verifies that we can overwrite it if it exists.
- Parameters:
path (
Union
[str
,Path
]) – Path to the file.overwrite (
bool
) – Whether to overwrite, in case of an existing file.
- Returns:
- static write(data, path, overwrite=False, verbose=True)[source]¶
Writes serializable data into a YAML file.
- Parameters:
data (
Union
[List
,Dict
]) – Serializable data.path (
Union
[str
,Path
]) – Path to the file.overwrite (
bool
) – Whether to overwrite, in case of an existing file.verbose (
Union
[bool
,int
]) – Verbosity of the method.
- Returns: