Skip to main content

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

Project description

ruamel.yaml

ruamel.yaml is a YAML 1.2 loader/dumper package for Python.

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 infomormation 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.

https://readthedocs.org/projects/yaml/badge/?version=stable https://bestpractices.coreinfrastructure.org/projects/1128/badge

ChangeLog

0.15.31 (2017-08-15):
  • fix Comment dumping

0.15.30 (2017-08-14):
  • fix for issue with “compact JSON” not parsing: {"in":{},"out":{}} (reported on StackOverflow by mjalkio

0.15.29 (2017-08-14):
  • fix issue #51: different indents for mappings and sequences (reported by Alex Harvey)

  • fix for flow sequence/mapping as element/value of block sequence with sequence-indent minus dash-offset not equal two.

0.15.28 (2017-08-13):
  • fix issue #61: merge of merge cannot be __repr__-ed (reported by Tal Liron)

0.15.27 (2017-08-13):
  • fix issue 62, YAML 1.2 allows ? and : in plain scalars if non-ambigious (reported by nowox)

  • fix lists within lists which would make comments disappear

0.15.26 (2017-08-10):
  • fix for disappearing comment after empty flow sequence (reported by oit-tzhimmash)

0.15.25 (2017-08-09):
  • fix for problem with dumping (unloaded) floats (reported by eyenseo)

0.15.24 (2017-08-09):
  • added ScalarFloat which supports roundtripping of 23.1, 23.100, 42.00E+56, 0.0, -0.0 etc. while keeping the format. Underscores in mantissas are not preserved/supported (yet, is anybody using that?).

  • (finally) fixed longstanding issue 23 (reported by Antony Sottile), now handling comment between block mapping key and value correctly

  • warn on YAML 1.1 float input that is incorrect (triggered by invalid YAML provided by Cecil Curry)

  • allow setting of boolean representation (false, true) by using: yaml.boolean_representation = [u'False', u'True']

0.15.23 (2017-08-01):
  • fix for round_tripping integers on 2.7.X > sys.maxint (reported by ccatterina)

0.15.22 (2017-07-28):
  • fix for round_tripping singe excl. mark tags doubling (reported and fix by Jan Brezina)

0.15.21 (2017-07-25):
0.15.20 (2017-07-23):
  • wheels for windows including C extensions

0.15.19 (2017-07-13):
  • added object constructor for rt, decorator yaml_object to replace YAMLObject.

  • fix for problem using load_all with Path() instance

  • fix for load_all in combination with zero indent block style literal (pure=True only!)

0.15.18 (2017-07-04):
  • missing pure attribute on YAML useful for implementing !include tag constructor for including YAML files in a YAML file

  • some documentation improvements

  • trigger of doc build on new revision

0.15.17 (2017-07-03):
  • support for Unicode supplementary Plane output (input was already supported, triggered by this Stack Overflow Q&A)

0.15.16 (2017-07-01):
  • minor typing issues (reported and fix provided by Manvendra Singh

  • small doc improvements

0.15.15 (2017-06-27):
0.15.14 (2017-06-25):
  • fix for issue 133, in setup.py: change ModuleNotFoundError to ImportError (reported and fix by Asley Drake)

0.15.13 (2017-06-24):
  • suppress duplicate key warning on mappings with merge keys (reported by Cameron Sweeney)

0.15.12 (2017-06-24):
  • remove fatal dependency of setup.py on wheel package (reported by Cameron Sweeney)

0.15.11 (2017-06-24):
  • fix for issue 130, regression in nested merge keys (reported by David Fee)

0.15.10 (2017-06-23):
  • top level PreservedScalarString not indented if not explicitly asked to

  • remove Makefile (not very useful anyway)

  • some mypy additions

0.15.9 (2017-06-16):
  • fix for issue 127: tagged scalars were always quoted and seperated by a newline when in a block sequence (reported and largely fixed by Tommy Wang)

0.15.8 (2017-06-15):
  • allow plug-in install via install ruamel.yaml[jinja2]

0.15.7 (2017-06-14):
  • add plug-in mechanism for load/dump pre resp. post-processing

0.15.6 (2017-06-10):
  • a set() with duplicate elements now throws error in rt loading

  • support for toplevel column zero literal/folded scalar in explicit documents

0.15.5 (2017-06-08):
  • repeat load() on a single YAML() instance would fail.

0.15.4 (2017-06-08):
  • transform parameter on dump that expects a function taking a string and returning a string. This allows transformation of the output before it is written to stream. This forces creation of the complete output in memory!

  • some updates to the docs

0.15.3 (2017-06-07):
  • No longer try to compile C extensions on Windows. Compilation can be forced by setting the environment variable RUAMEL_FORCE_EXT_BUILD to some value before starting the pip install.

0.15.2 (2017-06-07):
  • update to conform to mypy 0.511: mypy –strict

0.15.1 (2017-06-07):
  • duplicate keys in mappings generate an error (in the old API this change generates a warning until 0.16)

  • dependecy on ruamel.ordereddict for 2.7 now via extras_require

0.15.0 (2017-06-04):
  • it is now allowed to pass in a pathlib.Path as “stream” parameter to all load/dump functions

  • passing in a non-supported object (e.g. a string) as “stream” will result in a much more meaningful YAMLStreamError.

  • assigning a normal string value to an existing CommentedMap key or CommentedSeq element will result in a value cast to the previous value’s type if possible.

  • added YAML class for new API

0.14.12 (2017-05-14):
  • fix for issue 119, deepcopy not returning subclasses (reported and PR by Constantine Evans <cevans@evanslabs.org>)

0.14.11 (2017-05-01):
  • fix for issue 103 allowing implicit documents after document end marker line (...) in YAML 1.2

0.14.10 (2017-04-26):
  • fix problem with emitting using cyaml

0.14.9 (2017-04-22):
0.14.8 (2017-04-19):
  • fix Text not available on 3.5.0 and 3.5.1, now proactively setting version guards on all files (reported by João Paulo Magalhães)

0.14.7 (2017-04-18):
  • round trip of integers (decimal, octal, hex, binary) now preserve leading zero(s) padding and underscores. Underscores are presumed to be at regular distances (i.e. 0o12_345_67 dumps back as 0o1_23_45_67 as the space from the last digit to the underscore before that is the determining factor).

0.14.6 (2017-04-14):
  • binary, octal and hex integers are now preserved by default. This was a known deficiency. Working on this was prompted by the issue report (112) from devnoname120, as well as the additional experience with .replace() on scalarstring classes.

  • fix issues 114: cannot install on Buildozer (reported by mixmastamyk). Setting env. var RUAMEL_NO_PIP_INSTALL_CHECK will suppress pip-check.

0.14.5 (2017-04-04):
  • fix issue 109: None not dumping correctly at top level (reported by Andrea Censi)

  • fix issue 110: .replace on Preserved/DoubleQuoted/SingleQuoted ScalarString would give back “normal” string (reported by sandres23)

0.14.4 (2017-03-31):
  • fix readme

0.14.3 (2017-03-31):
0.14.2 (2017-03-23):
  • fix for old default pip on Ubuntu 14.04 (reported by Sébastien Maccagnoni-Munch)

0.14.1 (2017-03-22):
  • fix Text not available on 3.5.0 and 3.5.1 (reported by Charles Bouchard-Légaré)

0.14.0 (2017-03-21):
  • updates for mypy –strict

  • preparation for moving away from inheritance in Loader and Dumper, calls from e.g. the Representer to the Serializer.serialize() are now done via the attribute .serializer.serialize(). Usage of .serialize() outside of Serializer will be deprecated soon

  • some extra tests on main.py functions


For older changes see the file CHANGES

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ruamel.yaml-0.15.31.tar.gz (259.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ruamel.yaml-0.15.31-cp36-cp36m-win_amd64.whl (186.1 kB view details)

Uploaded CPython 3.6mWindows x86-64

ruamel.yaml-0.15.31-cp36-cp36m-win32.whl (171.8 kB view details)

Uploaded CPython 3.6mWindows x86

ruamel.yaml-0.15.31-cp36-cp36m-manylinux1_x86_64.whl (556.8 kB view details)

Uploaded CPython 3.6m

ruamel.yaml-0.15.31-cp35-cp35m-win_amd64.whl (186.1 kB view details)

Uploaded CPython 3.5mWindows x86-64

ruamel.yaml-0.15.31-cp35-cp35m-win32.whl (171.8 kB view details)

Uploaded CPython 3.5mWindows x86

ruamel.yaml-0.15.31-cp35-cp35m-manylinux1_x86_64.whl (556.6 kB view details)

Uploaded CPython 3.5m

ruamel.yaml-0.15.31-cp34-cp34m-win_amd64.whl (188.9 kB view details)

Uploaded CPython 3.4mWindows x86-64

ruamel.yaml-0.15.31-cp34-cp34m-win32.whl (178.0 kB view details)

Uploaded CPython 3.4mWindows x86

ruamel.yaml-0.15.31-cp34-cp34m-manylinux1_x86_64.whl (563.1 kB view details)

Uploaded CPython 3.4m

ruamel.yaml-0.15.31-cp33-cp33m-win_amd64.whl (188.7 kB view details)

Uploaded CPython 3.3mWindows x86-64

ruamel.yaml-0.15.31-cp33-cp33m-win32.whl (178.0 kB view details)

Uploaded CPython 3.3mWindows x86

ruamel.yaml-0.15.31-cp33-cp33m-manylinux1_x86_64.whl (537.3 kB view details)

Uploaded CPython 3.3m

ruamel.yaml-0.15.31-cp27-cp27mu-manylinux1_x86_64.whl (533.2 kB view details)

Uploaded CPython 2.7mu

ruamel.yaml-0.15.31-cp27-cp27m-win_amd64.whl (189.7 kB view details)

Uploaded CPython 2.7mWindows x86-64

ruamel.yaml-0.15.31-cp27-cp27m-win32.whl (177.9 kB view details)

Uploaded CPython 2.7mWindows x86

ruamel.yaml-0.15.31-cp27-cp27m-manylinux1_x86_64.whl (533.1 kB view details)

Uploaded CPython 2.7m

File details

Details for the file ruamel.yaml-0.15.31.tar.gz.

File metadata

  • Download URL: ruamel.yaml-0.15.31.tar.gz
  • Upload date:
  • Size: 259.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ruamel.yaml-0.15.31.tar.gz
Algorithm Hash digest
SHA256 de2d62023a9312952b82525ee5f0a16950644e70639e4623ce4ada8f527e1826
MD5 c64c09e026844b29b627e0138659849a
BLAKE2b-256 cc8f0aa322e739a98ae3c15db58ddf420d21f40a8786ddc92385aa2cd589efbd

See more details on using hashes here.

File details

Details for the file ruamel.yaml-0.15.31-cp36-cp36m-win_amd64.whl.

File metadata

File hashes

Hashes for ruamel.yaml-0.15.31-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 7e975cdf481531bad35edab9ab0c3282c1ee69a6f82fbd489aea1a8cac5d8c88
MD5 102d646c65e54f8c4d28d82919b5f259
BLAKE2b-256 d8629ab13733f3648354a952ea2cf1dd72848b9cbe69c22cb553935ead35f562

See more details on using hashes here.

File details

Details for the file ruamel.yaml-0.15.31-cp36-cp36m-win32.whl.

File metadata

File hashes

Hashes for ruamel.yaml-0.15.31-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 474423d9cc9659612c5b1244b3482b682418064975e57b8d359ed9095f6e84f2
MD5 a43143b0242fb98f0fe00cf7796ccfc6
BLAKE2b-256 25af2adf6d4c576915f3774450967da810adedcbeee000a25edd5a33f14845e1

See more details on using hashes here.

File details

Details for the file ruamel.yaml-0.15.31-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for ruamel.yaml-0.15.31-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 417803357f4e3441a8b32b3efae43597edcc85889f3bdf65a45ec5de3788bb8f
MD5 9169305fc9f2a1d043b241885cd31e27
BLAKE2b-256 acfcd3859ee446e2173f09ccfb57bc7d187d397564a4c38f8a345641e973a452

See more details on using hashes here.

File details

Details for the file ruamel.yaml-0.15.31-cp35-cp35m-win_amd64.whl.

File metadata

File hashes

Hashes for ruamel.yaml-0.15.31-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 a1098bca95dbf9c4224319003830a876380d17d0d8a98ba6cc9e8a62b186d9c6
MD5 5626dea1cd3d58f678800b12d6790c77
BLAKE2b-256 9083e0925172ceaedd9e318478cc01c303b07f3cb35b6e63facc43431fdceebc

See more details on using hashes here.

File details

Details for the file ruamel.yaml-0.15.31-cp35-cp35m-win32.whl.

File metadata

File hashes

Hashes for ruamel.yaml-0.15.31-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 01a0515940c310d834cb82f18926424af867a6f26babce920ac909248a63658b
MD5 10eb387d40854e1fc5e80a0114aa888d
BLAKE2b-256 020c376fa73255ab9343055add1bd87496455f91f36fa3f0d86a411c4545172c

See more details on using hashes here.

File details

Details for the file ruamel.yaml-0.15.31-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for ruamel.yaml-0.15.31-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 4349d4043ab12a8cd6533a5c71f267fc95f14d620cc08c90e2b8342818d35581
MD5 2bac988c94a4a2080670dd38082b755f
BLAKE2b-256 a3b4947bcf05593a862a6be9cb252f33f90f2658b3b2346c78de5f49a685481b

See more details on using hashes here.

File details

Details for the file ruamel.yaml-0.15.31-cp34-cp34m-win_amd64.whl.

File metadata

File hashes

Hashes for ruamel.yaml-0.15.31-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 5963877880f17b23b496ffb3a6184867b7e05fd36288552fe56bde239f5ee56f
MD5 485914287aefac60eace602caa26c054
BLAKE2b-256 0b4ac3c14e798a6257eb376ecc1428a8e3f9380997a3edc49fae4929c457e93f

See more details on using hashes here.

File details

Details for the file ruamel.yaml-0.15.31-cp34-cp34m-win32.whl.

File metadata

File hashes

Hashes for ruamel.yaml-0.15.31-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 fc9fc6cadffc19344615403d5063674e145603cc7b6db8627b89bcb4f4291ade
MD5 d87f6d9f97b77fa3e4cbb09190e10573
BLAKE2b-256 8d1533e32ad52c73c2704c850f948a064193721cb032c3780171ad2ace7f3afc

See more details on using hashes here.

File details

Details for the file ruamel.yaml-0.15.31-cp34-cp34m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for ruamel.yaml-0.15.31-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ce9361fb00fe38e0a6856515c0dfa0f97328bddd8499ed070390c345ae35f476
MD5 618b5492b9b181630eb63a71c3c33e48
BLAKE2b-256 6ce739dea4755d12947a5e3888fbe308b263d85a348f7ddd4e836cadec1de0f2

See more details on using hashes here.

File details

Details for the file ruamel.yaml-0.15.31-cp33-cp33m-win_amd64.whl.

File metadata

File hashes

Hashes for ruamel.yaml-0.15.31-cp33-cp33m-win_amd64.whl
Algorithm Hash digest
SHA256 d2699c8ba92912fdf93a101f52d0707869eef2ac66276bb38c7c397d9a676a88
MD5 919189847c0a7be789f3026c3ddf2e94
BLAKE2b-256 22d00f281c2e3388c69e205db9a7eb9b7ac1099ec2857b1ca2f79d94ef3f919a

See more details on using hashes here.

File details

Details for the file ruamel.yaml-0.15.31-cp33-cp33m-win32.whl.

File metadata

File hashes

Hashes for ruamel.yaml-0.15.31-cp33-cp33m-win32.whl
Algorithm Hash digest
SHA256 614e820698d9485ec76bc76c8fa7f4bde3c980f37bed2db507ce24d4ab320740
MD5 fa5d6821b8c51043e289b4e13209559f
BLAKE2b-256 7315552bdf155b281ef4c9dbccdc73c123ce7de744875f2cfcbe3e33ed942205

See more details on using hashes here.

File details

Details for the file ruamel.yaml-0.15.31-cp33-cp33m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for ruamel.yaml-0.15.31-cp33-cp33m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 cfa7b235433e9b67d668059061437c75f40120a74ba78b15dd90f2dd3fd68f76
MD5 4b9833540bb41d52cdce858b2aee4602
BLAKE2b-256 da49b8c122a13ea6aba3f8f8eab03a4332a6ea171b918d0dd11f4164adfaea2b

See more details on using hashes here.

File details

Details for the file ruamel.yaml-0.15.31-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for ruamel.yaml-0.15.31-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 8ed92fbfd4ac8bfca98d6036fb0248a4219ebc9a0c4f1ebbd5a9616b2d004263
MD5 9f4748ab0488ecaf17df30ac396b6b2f
BLAKE2b-256 4a9c4385869afbfb6db3c2823fa39bb5e1ec8565eedce035623692411297d97e

See more details on using hashes here.

File details

Details for the file ruamel.yaml-0.15.31-cp27-cp27m-win_amd64.whl.

File metadata

File hashes

Hashes for ruamel.yaml-0.15.31-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 cd8c7f50b8030475b6a4e79ef97eed7e024ea5872e25a1eb25089dee33e715f8
MD5 d320875da3e973933082bc37b3b1cdc7
BLAKE2b-256 b96fa745da91d1b241a25c138a2ee14951c39bdf11615ad33d5142b843652903

See more details on using hashes here.

File details

Details for the file ruamel.yaml-0.15.31-cp27-cp27m-win32.whl.

File metadata

File hashes

Hashes for ruamel.yaml-0.15.31-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 22ad6562da3ea91c754b1d7e8bdd08e1f3a5ba2f0c4ed3a38836f1adb3da2f27
MD5 f6f0645bec016af5bba4f23d2185eca9
BLAKE2b-256 e3bc9f1d84d1df7f65e900a4d9fb1a9cd50c2a2f07a40c83b6575cb0894e51ed

See more details on using hashes here.

File details

Details for the file ruamel.yaml-0.15.31-cp27-cp27m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for ruamel.yaml-0.15.31-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c67b9c35e4da4a1a1ed73260efeeea511658b11cacb83fa36144d502aecd6746
MD5 e2230296e7a63c4010c55ba54be1938c
BLAKE2b-256 4974196d962f430b4cbe7aa99f195061d05fb49be4c12873b351d238d85be89e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page