rex.utilities.utilities.safe_yaml_load

safe_yaml_load(fpath)[source]

Perform a yaml file load with better exception handling.

Parameters

fpath (str) – Filepath to .yaml (or .yml) file.

Returns

dict – Loaded yaml dictionary.

Examples

>>> yaml_path = "./path_to_yaml.yaml"
>>> safe_yaml_load(yaml_path)
{key1: value1,
 key2: value2}