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.37 (2018-03-21):
  • again trying to create installable files for 187

0.15.36 (2018-02-07):
  • fix issue 187, incompatibility of C extension with 3.7 (reported by Daniel Blanchard)

0.15.35 (2017-12-03):
  • allow None as stream when specifying transform parameters to YAML.dump(). This is useful if the transforming function doesn’t return a meaningful value (inspired by StackOverflow by rsaw).

0.15.34 (2017-09-17):
  • fix for issue 157: CDumper not dumping floats (reported by Jan Smitka)

0.15.33 (2017-08-31):
  • support for “undefined” round-tripping tagged scalar objects (in addition to tagged mapping object). Inspired by a use case presented by Matthew Patton on StackOverflow.

  • fix issue 148: replace cryptic error message when using !!timestamp with an incorrectly formatted or non- scalar. Reported by FichteFoll.

0.15.32 (2017-08-21):
  • allow setting yaml.default_flow_style = None (default: False) for for typ='rt'.

  • fix for issue 149: multiplications on ScalarFloat now return float (reported by jan.brezina@tul.cz)

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.37.tar.gz (280.2 kB view details)

Uploaded Source

Built Distributions

ruamel.yaml-0.15.37-cp36-cp36m-win_amd64.whl (209.2 kB view details)

Uploaded CPython 3.6mWindows x86-64

ruamel.yaml-0.15.37-cp36-cp36m-win32.whl (189.5 kB view details)

Uploaded CPython 3.6mWindows x86

ruamel.yaml-0.15.37-cp36-cp36m-manylinux1_x86_64.whl (641.6 kB view details)

Uploaded CPython 3.6m

ruamel.yaml-0.15.37-cp35-cp35m-win_amd64.whl (206.0 kB view details)

Uploaded CPython 3.5mWindows x86-64

ruamel.yaml-0.15.37-cp35-cp35m-win32.whl (186.6 kB view details)

Uploaded CPython 3.5mWindows x86

ruamel.yaml-0.15.37-cp35-cp35m-manylinux1_x86_64.whl (621.7 kB view details)

Uploaded CPython 3.5m

ruamel.yaml-0.15.37-cp34-cp34m-win_amd64.whl (208.1 kB view details)

Uploaded CPython 3.4mWindows x86-64

ruamel.yaml-0.15.37-cp34-cp34m-win32.whl (194.8 kB view details)

Uploaded CPython 3.4mWindows x86

ruamel.yaml-0.15.37-cp34-cp34m-manylinux1_x86_64.whl (631.9 kB view details)

Uploaded CPython 3.4m

ruamel.yaml-0.15.37-cp33-cp33m-win_amd64.whl (208.3 kB view details)

Uploaded CPython 3.3mWindows x86-64

ruamel.yaml-0.15.37-cp33-cp33m-win32.whl (194.7 kB view details)

Uploaded CPython 3.3mWindows x86

ruamel.yaml-0.15.37-cp33-cp33m-manylinux1_x86_64.whl (601.4 kB view details)

Uploaded CPython 3.3m

ruamel.yaml-0.15.37-cp27-cp27mu-manylinux1_x86_64.whl (590.0 kB view details)

Uploaded CPython 2.7mu

ruamel.yaml-0.15.37-cp27-cp27m-win_amd64.whl (213.0 kB view details)

Uploaded CPython 2.7mWindows x86-64

ruamel.yaml-0.15.37-cp27-cp27m-win32.whl (194.7 kB view details)

Uploaded CPython 2.7mWindows x86

ruamel.yaml-0.15.37-cp27-cp27m-manylinux1_x86_64.whl (590.0 kB view details)

Uploaded CPython 2.7m

File details

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

File metadata

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

File hashes

Hashes for ruamel.yaml-0.15.37.tar.gz
Algorithm Hash digest
SHA256 509842d96fb194f79b57483b76429f8956d8f7ade3cb49d1e5aeb5c5e9ef4918
MD5 b12de6c3ee60bbb150a35d1f4058a381
BLAKE2b-256 c1ad9557a78f1b61951623c56225e05dacdd81f80519f13fc39a926a5793edfa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ruamel.yaml-0.15.37-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 766ee90985c667f77bf34950b1d945624c263ecb82d859961f78effb3355c946
MD5 a0383a5851d3d143bed7d30e69a40ab2
BLAKE2b-256 7f01a9addc44fc688c3d6e898e60da34e51f8be06129d551d54e2f7df7da7d02

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ruamel.yaml-0.15.37-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 7afefe5dab4381393a2aa7ccb585ffd6080d52e7cd05f1df3788e9d0e4dfcea9
MD5 9cf5b8e0694861b0eddb542526b6171f
BLAKE2b-256 fa24cd4f8dc6f87ffd0a13d953e005b553bf872afe995272ded2348996e1e411

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ruamel.yaml-0.15.37-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 759b485e8cda260bd87b7cdd2ad936a0ec359ee6154a9d856357446792b3faf5
MD5 38cace44ac3202334ad17b05ee3aa121
BLAKE2b-256 98ccba3b6ccd0a4f6c51d128742fc5f0f43ae570d67174342578591c50f30013

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ruamel.yaml-0.15.37-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 2d1df676ac75fb5e0af7b91f7718a4b4f469a5d8ac4150edecc61f063283bbee
MD5 8f624813dd549195a694b9d75cf1f3ab
BLAKE2b-256 ba6e7c506b55217c594578108dffe95760a27bdd2ba3c05febeb27f6b1137aaf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ruamel.yaml-0.15.37-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 1d46053cb7acf0cd6b375e34abfb94f2e97c39269c17eb8b0226fe8a470c4ced
MD5 53de9716666e6a5e6955fbdb436b9aa4
BLAKE2b-256 eb86b970ea0ce10cb8cab099f6ad938bb168f38051131b6f9eec1ab60727a43f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ruamel.yaml-0.15.37-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 882cacb8af5f7009780da75041ef131d0ec80d9e0b81d3cf8d4b49a0a33fe6ef
MD5 6ee64705597fd5cd1248c7349fe52b27
BLAKE2b-256 cde50a85f31564d78ef157d5ddecb950ab08f3bcbf1fbffcd1447e0d272914b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ruamel.yaml-0.15.37-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 cea830caa479ae083f51ffdb55fe430a2763e853a7b06195f203db6d28bf5264
MD5 ca031f1d40f770fa0e5ac98623f962e2
BLAKE2b-256 6a09101d5474f7a15108e8de1582021dca245616c6f1c8981d1214d87714e3ba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ruamel.yaml-0.15.37-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 f5ef82b8efe378de6abb7042263d6f407b0760ad923ed477fa26007b1fa0e563
MD5 ecc68df6a524358475ee1cfe4ce76bdb
BLAKE2b-256 d808f956cad9511d890dd8178e99525807bc63420f2930360e1e4cb52d296c2e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ruamel.yaml-0.15.37-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 039bb5b50a2f3b17c969ed1d381e050bca851e3c13fe8c2a9ad18f605ca111a5
MD5 fc0c85106cb48364182223778b969c26
BLAKE2b-256 f709c73bc6b27571053945c5d8e6116a484355bd8358a23fddd5ff2f83b62018

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ruamel.yaml-0.15.37-cp33-cp33m-win_amd64.whl
Algorithm Hash digest
SHA256 656dcd3d30774ffe252e46db96f4cf24b284d42c904b93f9cbe6b234028f7d2e
MD5 42e7c2f151f2c909f7fb788addaeb714
BLAKE2b-256 1f47c8064e46919c5b92b958e20c94ce8799874580330a9e42948598bdd71e28

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ruamel.yaml-0.15.37-cp33-cp33m-win32.whl
Algorithm Hash digest
SHA256 dc051cd1fe541e321f6846bddba8e2c0de8ca409d51a6d9917c7b970d8d89a3d
MD5 14adf55c2782b40c27328a83e3dd02f6
BLAKE2b-256 3097e37d5b6b4a2d3e1de44181cdd77d93672c907bbea6e8e017104e74b7e759

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ruamel.yaml-0.15.37-cp33-cp33m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 6932e1ad63c805a41665a94e5d7b70808e9e25943f72afba6d327fede2aeb43d
MD5 d46b70bf655a865c81a25827a4b9e180
BLAKE2b-256 2a33279a12a287905a3646f0cce6ef00c03ee1b05a6ea430a023c60fa433aedd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ruamel.yaml-0.15.37-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 4b1929101d09612e0c7a42fbe06b0f929a4a89e1d14832353c1eb073580d3ba6
MD5 6a86591d54910d26a0be179b4dd649e9
BLAKE2b-256 0e2740c3af76e767285917319531f885109ad7bcb6a2715fe5116a9931219a26

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ruamel.yaml-0.15.37-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 b6bc5f434d72a672dbe48471e70771789d5d93603716c9e36963fe1dc7a35718
MD5 4c947184d05a80742ff443abd8cc293e
BLAKE2b-256 c6ece1d16b2add8ad4dcdd7622c1e41c7f76ffc9be3d39323ac7d8c2b1fe1e0b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ruamel.yaml-0.15.37-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 181699cc08b157ef8a59a77e96a01b5ffa150044ed4e49fd98428ab9ac0e6ed9
MD5 c89a821000c930c15e07cdc26b53fe27
BLAKE2b-256 3e988deef66ad5154de4f2cd192532c40b1e39a9a421812665f5c0e02596306c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ruamel.yaml-0.15.37-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e4d53f6a0c21d8effc23371927e8569096d0364d7c703b2e6956c6281b6bde2c
MD5 8a2aa496ab84ea54e7a35f2aa43cb749
BLAKE2b-256 2e992e836d2fb8f723eee8a6d8be5f60ee98b6617c513ffd8b2eb9c0940f337a

See more details on using hashes here.

Supported by

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