Differences with PyYAML¶
If I have seen further, it is by standing on the shoulders of giants. Isaac Newton (1676)
ruamel.yaml is a derivative of Kirill Simonov’s PyYAML 3.11 and would not exist without that
excellent base to start from.
The following a summary of the major differences with PyYAML 3.11
Defaulting to YAML 1.2 support¶
- YAML 1.2 dropped support for several features unquoted
- YAML 1.2 no longer accepts strings that start with a
0and solely consist of number characters as octal, you need to specify such strings with
0o[0-7]+(zero + lower-case o for octal + one or more octal characters).
- YAML 1.2 no longer supports sexagesimals, so the string scalar
12:34:56doesn’t need quoting.
\/escape for JSON compatibility
- correct parsing of floating point scalars with exponentials
unless the YAML document is loaded with an explicit
the document starts with:
% YAML 1.1
ruamel.yaml will load the document as version 1.2.
ruamel.yaml re-integrates the Python 2 and 3 sources, running on
Python 2.7 (CPython, PyPy), 3.3, 3.4, 3.5 and 3.6 (support for 2.6 has been
dropped mid 2016). It is more easy to extend and maintain as only a
miniscule part of the code is Python version specific.
indentkeyword argument on scalars when dumping.
:in plain scalars, as long as these are not followed by a space (as per the specification)
Before versions are pushed to PyPI,
tox is invoked, and has to pass, on all
supported Python versions, on PyPI as well as flake8/pep8
Starting with 0.15 the API for using
ruamel.yaml has diverged allowing easier
addition of new features.