ruamel.yaml is a YAML 1.2 loader/dumper package for Python.
version: | 0.16.7 |
---|---|
updated: | 2020-01-30 |
documentation: | http://yaml.readthedocs.io |
repository: | https://bitbucket.org/ruamel/yaml |
pypi: | https://pypi.org/project/ruamel.yaml/ |
Starting with version 0.15.0 the way YAML files are loaded and dumped is changing. See the API doc for details. Currently existing functionality will throw a warning before being changed/removed. For production systems you should pin the version being used with ``ruamel.yaml<=0.15``. There might be bug fixes in the 0.14 series, but new functionality is likely only to be available via the new API.
If your package uses ruamel.yaml and is not listed on PyPI, drop me an email, preferably with some information on how you use the package (or a link to bitbucket/github) and I'll keep you informed when the status of the API is stable enough to make the transition.
simple mappings can now be used as keys when round-tripping:
{a: 1, b: 2}: hello world
although using the obvious operations (del, popitem) on the key will fail, you can mutilate it by going through its attributes. If you load the above YAML in d, then changing the value is cumbersome:
d = {CommentedKeyMap([('a', 1), ('b', 2)]): "goodbye"}
and changing the key even more so:
- d[CommentedKeyMap([('b', 1), ('a', 2)])] = d.pop(
CommentedKeyMap([('a', 1), ('b', 2)]))
(you can use a dict instead of a list of tuples (or ordereddict), but that might result in a different order, of the keys of the key, in the output)
check integers to dump with 1.2 patterns instead of 1.1 (reported by Lele Gaifax)
For older changes see the file CHANGES