Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

A few extensions to pyyaml.

Project description

Build Status Azure DevOps coverage

aspy.yaml

Some extensions to pyyaml.

Installation

pip install aspy.yaml

aspy.yaml.ordered_load

yaml.load which respects order for dictionaries in the yaml file.

>>> from aspy.yaml import ordered_load
>>> ordered_load(
        'foo: bar\n'
        'bar: baz\n'
        'herp: derp\n'
    )
OrderedDict([('foo', 'bar'), ('bar', 'baz'), ('herp', 'derp')])

aspy.yaml.ordered_dump

yaml.dump which respects order for dictionaries in the yaml file.

>>> from aspy.yaml import ordered_dump
>>> print(ordered_dump(
        OrderedDict((('a', '1'), ('b', '2'), ('c', '3'), ('d', '4'))),
        default_flow_style=False,
    ))
a: '1'
b: '2'
c: '3'
d: '4'

Project details


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
aspy.yaml-1.3.0-py2.py3-none-any.whl (3.5 kB) Copy SHA256 hash SHA256 Wheel py2.py3
aspy.yaml-1.3.0.tar.gz (3.0 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page