codebox: YAML utilities

YAML utility tools

codebox.yaml_tools.load(path: str, recursive: bool = False, match_pattern: Optional[str] = None, ignore_empty: bool = False, parse_jinja: bool = False, jinja_context: Optional[dict] = None) dict[source]

Loads and parses a file or a folder containing yaml files. All existing dictionaries will be deeply merged. Merge order respects file path sorted by name.

Parameters
  • path (str) – File or directory path.

  • recursive (bool, optional) – Defaults to False. Whether or not to include subdirectoties.

  • match_pattern (str, optional) – A regular expression to be used to filter the files to be load based on the file’s full name.

  • ignore_empty (bool, optional) – Whether to ignore empty files.

  • parse_jinja (bool, optional) – Whether to parse Jinja code.

  • jinja_context (dict, optional) – The Jinja Context.

Returns

dict