ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order WWW: https://bitbucket.org/ruamel/yaml