2020-02-05 08:31:01 -06:00
|
|
|
from pathlib import Path
|
2021-02-08 04:59:33 -06:00
|
|
|
|
2020-10-17 14:51:38 -05:00
|
|
|
from ruamel.yaml import YAML
|
|
|
|
|
2020-02-05 08:31:01 -06:00
|
|
|
|
|
|
|
def load_yaml(yaml_file: str):
|
2021-02-08 04:59:33 -06: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)
|