Metadata-Version: 2.4
Name: aspy.yaml
Version: 1.3.0
Summary: A few extensions to pyyaml.
Home-page: https://github.com/asottile/aspy.yaml
Author: Anthony Sottile
Author-email: asottile@umich.edu
License: MIT
Platform: all
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: !=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pyyaml
Dynamic: license-file

[![Build Status](https://asottile.visualstudio.com/asottile/_apis/build/status/asottile.aspy.yaml?branchName=master)](https://asottile.visualstudio.com/asottile/_build/latest?definitionId=4&branchName=master)
[![Azure DevOps coverage](https://img.shields.io/azure-devops/coverage/asottile/asottile/4/master.svg)](https://dev.azure.com/asottile/asottile/_build/latest?definitionId=4&branchName=master)

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.

```python
>>> 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.

```python
>>> 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'
```
