2020-02-05 15:31:01 +01:00
|
|
|
from pathlib import Path
|
2021-02-08 11:59:33 +01:00
|
|
|
|
2020-10-17 21:51:38 +02:00
|
|
|
from ruamel.yaml import YAML
|
|
|
|
|
2020-02-05 15:31:01 +01:00
|
|
|
|
|
|
|
def load_yaml(yaml_file: str):
|
2021-02-08 11:59:33 +01:00
|
|
|
yf = Path(yaml_file)
|
|
|
|
if not yf.is_file():
|
|
|
|
return None
|
|
|
|
with yf.open("r") as stream:
|
|
|
|
yaml = YAML(typ="safe")
|
|
|
|
return yaml.load(stream)
|