xbudget.presets.load_yaml¶
- xbudget.presets.load_yaml(filepath)[source]¶
Loads a yaml file as a Python dictionary.
This is a thin reader: it does not check that the result is a valid xbudget recipe, because the shipped recipes contain placeholder terms that the parser deliberately warns about and skips, and re-reading a file should not re-raise those warnings. To validate, call
xbudget.parse_budgets()on the result (or usesave_yaml(), which validates before writing).- Parameters:
filepath (path to yaml file, as str)
- Return type:
Python dictionary
- Raises:
yaml.YAMLError – If the file is not valid YAML.
See also
save_yaml,xbudget.parse_budgets