ruamel.yaml is a YAML 1.2 loader/dumper library for Python, with round-trip preservation of comments, tags and flow style. It is a superset of the PyYAML package. Use this tag for issues with features or installation of that are ruamel.yaml specific.
ruamel.yaml is a YAML 1.2 loader/dumper package for Python. It was originally a derivative of Kirill Simonov’s PyYAML 3.11. Apart from supporting the YAML 1.2 from 2009, and not just the YAML 1.1 specification from 2005, it includes bugfixes and enhancements for round-tripping (i.e. load, modify, dump):
- preservation of comments and style
- preservation of anchor names
- preservation of merges
- loading/dumping of tags without class registration
ruamel.yaml also includes routines to analyse sequence indentations and control over block style sequences dumping.
Installation on most systems can be done from PyPI using:
pip install ruamel.yaml
or on modern Debian and derivatives like Ubuntu 16.04 with:
sudo apt-get install python-ruamel.yaml
The source for the package can be found on bitbucket.