YAML Provider¶
Wraps yaml library to read and write yaml.
Hooks¶
Type | Description | Return |
---|---|---|
yaml | Hook for reading and writing yaml. Hook reads from path if no data field is provided, otherwise it writes the data to path . |
Union[dict, str] |
yaml_decode | Hook for decoding a yaml string to a dict. | dict |
yaml_encode | Hook for converting a dict to a yaml encoded string. | str |
yaml_in_place | Hook for modifying a yaml in place (ie read, transform, and write back to the file in one operation). WIP -> https://github.com/sudoblockio/tackle/issues/100. | Union[str, dict] |
Examples¶
Read yaml¶
Read a yaml file into a key
compact->: yaml path/to/file.yaml
expanded:
->: yaml
path: path/to/file.yaml
Write yaml¶
Read a yaml file into a key
stuff:
and: things
compact->: yaml path/to/file.yaml "{{stuff}}"
expanded:
->: yaml
path: path/to/file.yaml
contents: "{{ stuff }}"