Modify/Update YAML Files Using Python 3 & ruamel.yaml
If you want to preserve the order of your mapping keys, the white space between the elements of the root-level sequence, and the comment, e.g. because this file is under revision control, then I would highly suggest you use ruamel.yaml Write your YAML code in a file called input.yaml. We are using this file inside … Read more