A few extensions to pyyaml.
Project description
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
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
aspy.yaml-1.3.0.tar.gz
(3.0 kB
view hashes)
Built Distribution
Close
Hashes for aspy.yaml-1.3.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 463372c043f70160a9ec950c3f1e4c3a82db5fca01d334b6bc89c7164d744bdc |
|
MD5 | ad96ebcbdd043f9d8f608f3aecba58e3 |
|
BLAKE2b-256 | 99ce78be097b00817ccf02deaf481eb7a603eecee6fa216e82fa7848cd265449 |