pureyaml

Yet another yaml parser, in pure python.


Keywords
pureyaml, Manu, Phatak
License
MIT
Install
pip install pureyaml==0.1.0

Documentation

pureyaml

Latest Version Development Status Build Status Coverage Status Documentation Status

Yet another yaml parser, in pure python.

Features

Installation

At the command line either via easy_install or pip

$ pip install pureyaml
$ easy_install pureyaml

Or, if you have virtualenvwrapper installed

$ mkvirtualenv pureyaml
$ pip install pureyaml

Uninstall

$ pip uninstall pureyaml

Usage

To use pureyaml in a project

import pureyaml

>>> import pureyaml
>>> from textwrap import dedent
>>> from pprint import pprint
>>> text = dedent("""
...     marvel:
...     - iron man
...     - the hulk
...     - captain america
...     dc:
...     - batman
...     - the joker
...     - superman
... """)[1:]

>>> pprint(pureyaml.load(text))
{'dc': ['batman', 'the joker', 'superman'],
 'marvel': ['iron man', 'the hulk', 'captain america']}

>>> print(pureyaml.dump(pureyaml.load(text)))
dc:
- batman
- the joker
- superman
marvel:
- iron man
- the hulk
- captain america

Credits

Tools used in rendering this package: