2024-08-09 12:41:23 +02:00
|
|
|
import pathlib
|
2024-08-13 15:02:03 +02:00
|
|
|
from typing import Any
|
2024-08-09 12:41:23 +02:00
|
|
|
|
|
|
|
|
import yaml
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def read_yaml(path: pathlib.Path) -> dict:
|
|
|
|
|
with open(path) as f:
|
|
|
|
|
return yaml.safe_load(f)
|
2024-08-13 15:02:03 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def write_yaml(path: pathlib.Path, data: Any) -> None:
|
|
|
|
|
with open(path, "w") as outfile:
|
|
|
|
|
yaml.dump(data, outfile, default_flow_style=False)
|