yaml_tools.yasort module
Console script for sorting YAML lists.
- yaml_tools.yasort.get_input_yaml(filepath, prog_opts)[source]
Check filename extension, open and munge the contents, return data (where in this context we “munge” the curly braces to make it valid YAML).
- Parameters:
filepath – filename as Path obj
prog_opts (dict) – configuration options
- Return data_in:
file data
- Raises:
FileTypeError – if the input file is not yaml
- yaml_tools.yasort.process_inputs(filepath, prog_opts, debug=False)[source]
Handle file arguments and process them. Write new (sorted) files to the ‘sorted-out/’ directory in the current working directory.
- Parameters:
filepath – filename as Path obj
prog_opts (dict) – configuration options
debug – enable extra processing info
- Return None:
- Handles FileTypeError:
if input file is not yml