Welcome to pureyaml’s documentation!

Contents:

pureyaml

Latest Version Development Status Build Status Coverage Status Documentation Status

Yet another yaml parser, in pure python.

Features

Credits

Tools used in rendering this package:

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

Contributing

Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.

You can contribute in many ways:

Types of Contributions

Report Bugs

Report bugs at https://github.com/bionikspoon/pureyaml/issues.

If you are reporting a bug, please include:

  • Your operating system name and version.
  • Any details about your local setup that might be helpful in troubleshooting.
  • Detailed steps to reproduce the bug.

Fix Bugs

Look through the GitHub issues for bugs. Anything tagged with “bug” is open to whoever wants to implement it.

Implement Features

Look through the GitHub issues for features. Anything tagged with “feature” is open to whoever wants to implement it.

Write Documentation

pureyaml could always use more documentation, whether as part of the official pureyaml docs, in docstrings, or even on the web in blog posts, articles, and such.

Submit Feedback

The best way to send feedback is to file an issue at https://github.com/bionikspoon/pureyaml/issues.

If you are proposing a feature:

  • Explain in detail how it would work.
  • Keep the scope as narrow as possible, to make it easier to implement.
  • Remember that this is a volunteer-driven project, and that contributions are welcome :)

Get Started!

Ready to contribute? Here’s how to set up pureyaml for local development.

  1. Fork the pureyaml repo on GitHub.

  2. Clone your fork locally:

    $ git clone git@github.com:your_name_here/pureyaml.git
    
  3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development:

    $ mkvirtualenv pureyaml
    $ cd pureyaml/
    $ python setup.py develop
    
  4. Create a branch for local development:

    $ git checkout -b feature/name-of-your-feature
    $ git checkout -b hotfix/name-of-your-bugfix
    

    Now you can make your changes locally.

  5. When you’re done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox:

    $ flake8 pureyaml tests
    $ python setup.py test
    $ tox
    

    To get flake8 and tox, just pip install them into your virtualenv.

  6. Commit your changes and push your branch to GitHub:

    $ git add .
    $ git commit -m "Your detailed description of your changes."
    $ git push origin name-of-your-bugfix-or-feature
    
  7. Submit a pull request through the GitHub website.

Pull Request Guidelines

Before you submit a pull request, check that it meets these guidelines:

  1. The pull request should include tests.
  2. If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in README.rst.
  3. The pull request should work for Python 2.6, 2.7, 3.3, 3.4, 3.5, and PyPy. Check https://travis-ci.org/bionikspoon/pureyaml/pull_requests and make sure that the tests pass for all supported Python versions.

Tips

To run a subset of tests:

$ py.test tests/test_pureyaml.py

Credits

Development Lead

Contributors

None yet. Why not be the first?

History

Next Release

  • Coming Soon

0.1.0 (2016-01-xx)

  • Coming Soon

pureyaml package

pureyaml

Yet another yaml parser, in pure python.

pureyaml.dump(obj, fp=None, indent=None, sort_keys=False, **kw)[source]

Dump object to a file like object or string.

Parameters:
  • obj
  • fp – Open file like object
  • indent (int) – Indent size, default 2
  • sort_keys (bool) – Optionally sort dictionary keys.
Returns:

Yaml serialized data.

pureyaml.dumps(obj, indent=None, default=None, sort_keys=False, **kw)[source]

Dump string.

pureyaml.load(s, **kwargs)[source]

Load yaml file

pureyaml.loads(s, cls=None, **kwargs)[source]

Load string

Subpackages

pureyaml._compat package

Python 2to3 compatibility handling.

class pureyaml._compat.NullHandler(level=0)[source]

Bases: logging.Handler

This handler does nothing. It’s intended to be used to avoid the “No handlers could be found for logger XXX” one-off warning. This is important for library code, which may contain code to log events. If a user of the library does not configure logging, the one-off warning might be produced; to avoid this, the library developer simply needs to instantiate a NullHandler and add it to the top-level logger of the library module or package.

__doc__ = '\n This handler does nothing. It\'s intended to be used to avoid the\n "No handlers could be found for logger XXX" one-off warning. This is\n important for library code, which may contain code to log events. If a user\n of the library does not configure logging, the one-off warning might be\n produced; to avoid this, the library developer simply needs to instantiate\n a NullHandler and add it to the top-level logger of the library module or\n package.\n '
__module__ = 'logging'
createLock()[source]
emit(record)[source]
handle(record)[source]
class pureyaml._compat.collections_abc[source]
class Callable

Bases: object

__abstractmethods__ = frozenset(['__call__'])
__call__(*args, **kwds)
__dict__ = dict_proxy({'_abc_cache': <_weakrefset.WeakSet object at 0x7f1d964ba6d0>, '__module__': '_abcoll', '__metaclass__': <class 'abc.ABCMeta'>, '_abc_registry': <_weakrefset.WeakSet object at 0x7f1d964ba610>, '__abstractmethods__': frozenset(['__call__']), '__dict__': <attribute '__dict__' of 'Callable' objects>, '__subclasshook__': <classmethod object at 0x7f1d964a7b78>, '_abc_negative_cache_version': 1, '_abc_negative_cache': <_weakrefset.WeakSet object at 0x7f1d964ba750>, '__call__': <function __call__ at 0x7f1d9640f578>, '__weakref__': <attribute '__weakref__' of 'Callable' objects>, '__doc__': None})
__doc__ = None
__metaclass__

alias of ABCMeta

__module__ = '_abcoll'
classmethod __subclasshook__(C)
__weakref__

list of weak references to the object (if defined)

_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 1
_abc_registry = <_weakrefset.WeakSet object>
class collections_abc.Container

Bases: object

__abstractmethods__ = frozenset(['__contains__'])
__contains__(x)
__dict__ = dict_proxy({'_abc_cache': <_weakrefset.WeakSet object at 0x7f1d964ba510>, '__module__': '_abcoll', '__metaclass__': <class 'abc.ABCMeta'>, '__contains__': <function __contains__ at 0x7f1d9640f320>, '_abc_registry': <_weakrefset.WeakSet object at 0x7f1d964ba450>, '__abstractmethods__': frozenset(['__contains__']), '__subclasshook__': <classmethod object at 0x7f1d964a7b40>, '_abc_negative_cache_version': 1, '_abc_negative_cache': <_weakrefset.WeakSet object at 0x7f1d964ba590>, '__dict__': <attribute '__dict__' of 'Container' objects>, '__weakref__': <attribute '__weakref__' of 'Container' objects>, '__doc__': None})
__doc__ = None
__metaclass__

alias of ABCMeta

__module__ = '_abcoll'
classmethod __subclasshook__(C)
__weakref__

list of weak references to the object (if defined)

_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 1
_abc_registry = <_weakrefset.WeakSet object>
class collections_abc.Hashable

Bases: object

__abstractmethods__ = frozenset(['__hash__'])
__dict__ = dict_proxy({'_abc_cache': <_weakrefset.WeakSet object at 0x7f1d964b3dd0>, '__module__': '_abcoll', '__metaclass__': <class 'abc.ABCMeta'>, '_abc_registry': <_weakrefset.WeakSet object at 0x7f1d964ab9d0>, '__abstractmethods__': frozenset(['__hash__']), '__dict__': <attribute '__dict__' of 'Hashable' objects>, '__subclasshook__': <classmethod object at 0x7f1d964a7600>, '_abc_negative_cache_version': 0, '_abc_negative_cache': <_weakrefset.WeakSet object at 0x7f1d964b3e50>, '__hash__': <function __hash__ at 0x7f1d964b88c0>, '__weakref__': <attribute '__weakref__' of 'Hashable' objects>, '__doc__': None})
__doc__ = None
__hash__()
__metaclass__

alias of ABCMeta

__module__ = '_abcoll'
classmethod __subclasshook__(C)
__weakref__

list of weak references to the object (if defined)

_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 0
_abc_registry = <_weakrefset.WeakSet object>
class collections_abc.ItemsView(mapping)

Bases: _abcoll.MappingView, _abcoll.Set

__abstractmethods__ = frozenset([])
__contains__(item)
__doc__ = None
__iter__()
__module__ = '_abcoll'
_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 3
_abc_registry = <_weakrefset.WeakSet object>
classmethod _from_iterable(it)
class collections_abc.Iterable

Bases: object

__abstractmethods__ = frozenset(['__iter__'])
__dict__ = dict_proxy({'_abc_cache': <_weakrefset.WeakSet object at 0x7f1d964b3f90>, '__module__': '_abcoll', '__metaclass__': <class 'abc.ABCMeta'>, '_abc_registry': <_weakrefset.WeakSet object at 0x7f1d964b3ed0>, '__abstractmethods__': frozenset(['__iter__']), '__iter__': <function __iter__ at 0x7f1d964b8b18>, '__subclasshook__': <classmethod object at 0x7f1d964a75c8>, '_abc_negative_cache_version': 0, '_abc_negative_cache': <_weakrefset.WeakSet object at 0x7f1d964ba050>, '__dict__': <attribute '__dict__' of 'Iterable' objects>, '__weakref__': <attribute '__weakref__' of 'Iterable' objects>, '__doc__': None})
__doc__ = None
__iter__()
__metaclass__

alias of ABCMeta

__module__ = '_abcoll'
classmethod __subclasshook__(C)
__weakref__

list of weak references to the object (if defined)

_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 0
_abc_registry = <_weakrefset.WeakSet object>
class collections_abc.Iterator

Bases: _abcoll.Iterable

__abstractmethods__ = frozenset(['next'])
__doc__ = None
__iter__()
__module__ = '_abcoll'
classmethod __subclasshook__(C)
_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 1
_abc_registry = <_weakrefset.WeakSet object>
next()

Return the next item from the iterator. When exhausted, raise StopIteration

class collections_abc.KeysView(mapping)

Bases: _abcoll.MappingView, _abcoll.Set

__abstractmethods__ = frozenset([])
__contains__(key)
__doc__ = None
__iter__()
__module__ = '_abcoll'
_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 3
_abc_registry = <_weakrefset.WeakSet object>
classmethod _from_iterable(it)
class collections_abc.Mapping

Bases: _abcoll.Sized, _abcoll.Iterable, _abcoll.Container

A Mapping is a generic container for associating key/value pairs.

This class provides concrete generic implementations of all methods except for __getitem__, __iter__, and __len__.

__abstractmethods__ = frozenset(['__iter__', '__getitem__', '__len__'])
__contains__(key)
__doc__ = 'A Mapping is a generic container for associating key/value\n pairs.\n\n This class provides concrete generic implementations of all\n methods except for __getitem__, __iter__, and __len__.\n\n '
__eq__(other)
__getitem__(key)
__hash__ = None
__module__ = '_abcoll'
__ne__(other)
_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 25
_abc_registry = <_weakrefset.WeakSet object>
get(k[, d]) → D[k] if k in D, else d. d defaults to None.
items() → list of D's (key, value) pairs, as 2-tuples
iteritems() → an iterator over the (key, value) items of D
iterkeys() → an iterator over the keys of D
itervalues() → an iterator over the values of D
keys() → list of D's keys
values() → list of D's values
class collections_abc.MappingView(mapping)

Bases: _abcoll.Sized

__abstractmethods__ = frozenset([])
__doc__ = None
__init__(mapping)
__len__()
__module__ = '_abcoll'
__repr__()
_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 3
_abc_registry = <_weakrefset.WeakSet object>
class collections_abc.MutableMapping

Bases: _abcoll.Mapping

A MutableMapping is a generic container for associating key/value pairs.

This class provides concrete generic implementations of all methods except for __getitem__, __setitem__, __delitem__, __iter__, and __len__.

_MutableMapping__marker = <object object>
__abstractmethods__ = frozenset(['__delitem__', '__setitem__', '__getitem__', '__iter__', '__len__'])
__delitem__(key)
__doc__ = 'A MutableMapping is a generic container for associating\n key/value pairs.\n\n This class provides concrete generic implementations of all\n methods except for __getitem__, __setitem__, __delitem__,\n __iter__, and __len__.\n\n '
__module__ = '_abcoll'
__setitem__(key, value)
_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 25
_abc_registry = <_weakrefset.WeakSet object>
clear() → None. Remove all items from D.
pop(k[, d]) → v, remove specified key and return the corresponding value.

If key is not found, d is returned if given, otherwise KeyError is raised.

popitem() → (k, v), remove and return some (key, value) pair

as a 2-tuple; but raise KeyError if D is empty.

setdefault(k[, d]) → D.get(k,d), also set D[k]=d if k not in D
update([E, ]**F) → None. Update D from mapping/iterable E and F.

If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v

class collections_abc.MutableSequence

Bases: _abcoll.Sequence

All the operations on a read-only sequence.

Concrete subclasses must provide __new__ or __init__, __getitem__, __setitem__, __delitem__, __len__, and insert().

__abstractmethods__ = frozenset(['__delitem__', '__setitem__', '__getitem__', '__len__', 'insert'])
__delitem__(index)
__doc__ = 'All the operations on a read-only sequence.\n\n Concrete subclasses must provide __new__ or __init__,\n __getitem__, __setitem__, __delitem__, __len__, and insert().\n\n '
__iadd__(values)
__module__ = '_abcoll'
__setitem__(index, value)
_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 8
_abc_registry = <_weakrefset.WeakSet object>
append(value)

S.append(object) – append object to the end of the sequence

extend(values)

S.extend(iterable) – extend sequence by appending elements from the iterable

insert(index, value)

S.insert(index, object) – insert object before index

pop([index]) → item -- remove and return item at index (default last).

Raise IndexError if list is empty or index is out of range.

remove(value)

S.remove(value) – remove first occurrence of value. Raise ValueError if the value is not present.

reverse()

S.reverse() – reverse IN PLACE

class collections_abc.MutableSet

Bases: _abcoll.Set

A mutable set is a finite, iterable container.

This class provides concrete generic implementations of all methods except for __contains__, __iter__, __len__, add(), and discard().

To override the comparisons (presumably for speed, as the semantics are fixed), all you have to do is redefine __le__ and then the other operations will automatically follow suit.

__abstractmethods__ = frozenset(['discard', 'add', '__iter__', '__len__', '__contains__'])
__doc__ = 'A mutable set is a finite, iterable container.\n\n This class provides concrete generic implementations of all\n methods except for __contains__, __iter__, __len__,\n add(), and discard().\n\n To override the comparisons (presumably for speed, as the\n semantics are fixed), all you have to do is redefine __le__ and\n then the other operations will automatically follow suit.\n '
__iand__(it)
__ior__(it)
__isub__(it)
__ixor__(it)
__module__ = '_abcoll'
_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 2
_abc_registry = <_weakrefset.WeakSet object>
add(value)

Add an element.

clear()

This is slow (creates N new iterators!) but effective.

discard(value)

Remove an element. Do not raise an exception if absent.

pop()

Return the popped value. Raise KeyError if empty.

remove(value)

Remove an element. If not a member, raise a KeyError.

class collections_abc.Sequence

Bases: _abcoll.Sized, _abcoll.Iterable, _abcoll.Container

All the operations on a read-only sequence.

Concrete subclasses must override __new__ or __init__, __getitem__, and __len__.

__abstractmethods__ = frozenset(['__getitem__', '__len__'])
__contains__(value)
__doc__ = 'All the operations on a read-only sequence.\n\n Concrete subclasses must override __new__ or __init__,\n __getitem__, and __len__.\n '
__getitem__(index)
__iter__()
__module__ = '_abcoll'
__reversed__()
_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 7
_abc_registry = <_weakrefset.WeakSet object>
count(value) → integer -- return number of occurrences of value
index(value) → integer -- return first index of value.

Raises ValueError if the value is not present.

class collections_abc.Set

Bases: _abcoll.Sized, _abcoll.Iterable, _abcoll.Container

A set is a finite, iterable container.

This class provides concrete generic implementations of all methods except for __contains__, __iter__ and __len__.

To override the comparisons (presumably for speed, as the semantics are fixed), all you have to do is redefine __le__ and then the other operations will automatically follow suit.

__abstractmethods__ = frozenset(['__iter__', '__len__', '__contains__'])
__and__(other)
__doc__ = 'A set is a finite, iterable container.\n\n This class provides concrete generic implementations of all\n methods except for __contains__, __iter__ and __len__.\n\n To override the comparisons (presumably for speed, as the\n semantics are fixed), all you have to do is redefine __le__ and\n then the other operations will automatically follow suit.\n '
__eq__(other)
__ge__(other)
__gt__(other)
__hash__ = None
__le__(other)
__lt__(other)
__module__ = '_abcoll'
__ne__(other)
__or__(other)
__sub__(other)
__xor__(other)
_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 1
_abc_registry = <_weakrefset.WeakSet object>
classmethod _from_iterable(it)

Construct an instance of the class from any iterable input.

Must override this method if the class constructor signature does not accept an iterable for an input.

_hash()

Compute the hash value of a set.

Note that we don’t define __hash__: not all sets are hashable. But if you define a hashable set type, its __hash__ should call this function.

This must be compatible __eq__.

All sets ought to compare equal if they contain the same elements, regardless of how they are implemented, and regardless of the order of the elements; so there’s not much freedom for __eq__ or __hash__. We match the algorithm used by the built-in frozenset type.

isdisjoint(other)

Return True if two sets have a null intersection.

class collections_abc.Sized

Bases: object

__abstractmethods__ = frozenset(['__len__'])
__dict__ = dict_proxy({'_abc_cache': <_weakrefset.WeakSet object at 0x7f1d964ba350>, '__module__': '_abcoll', '__metaclass__': <class 'abc.ABCMeta'>, '_abc_registry': <_weakrefset.WeakSet object at 0x7f1d964ba290>, '__abstractmethods__': frozenset(['__len__']), '__subclasshook__': <classmethod object at 0x7f1d964a7b08>, '_abc_negative_cache_version': 1, '_abc_negative_cache': <_weakrefset.WeakSet object at 0x7f1d964ba3d0>, '__dict__': <attribute '__dict__' of 'Sized' objects>, '__weakref__': <attribute '__weakref__' of 'Sized' objects>, '__doc__': None, '__len__': <function __len__ at 0x7f1d9640f0c8>})
__doc__ = None
__len__()
__metaclass__

alias of ABCMeta

__module__ = '_abcoll'
classmethod __subclasshook__(C)
__weakref__

list of weak references to the object (if defined)

_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 1
_abc_registry = <_weakrefset.WeakSet object>
class collections_abc.ValuesView(mapping)

Bases: _abcoll.MappingView

__abstractmethods__ = frozenset([])
__contains__(value)
__doc__ = None
__iter__()
__module__ = '_abcoll'
_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 3
_abc_registry = <_weakrefset.WeakSet object>
collections_abc.__doc__ = None
collections_abc.__module__ = 'pureyaml._compat'
pureyaml._compat.total_ordering(cls)

Class decorator that fills in missing ordering methods

pureyaml._compat.singledispatch(function)[source]

Single-dispatch generic function decorator.

Transforms a function into a generic function, which can have different behaviours depending upon the type of its first argument. The decorated function acts as the default implementation, and additional implementations can be registered using the register() attribute of the generic function.

Submodules
pureyaml._compat.singledispatch module
pureyaml._compat.singledispatch.singledispatch(function)[source]

Single-dispatch generic function decorator.

Transforms a function into a generic function, which can have different behaviours depending upon the type of its first argument. The decorated function acts as the default implementation, and additional implementations can be registered using the register() attribute of the generic function.

pureyaml._compat.singledispatch_helpers module
class pureyaml._compat.singledispatch_helpers.ChainMap(*maps)[source]

Bases: _abcoll.MutableMapping

A ChainMap groups multiple dicts (or other mappings) together to create a single, updateable view.

The underlying mappings are stored in a list. That list is public and can accessed or updated using the maps attribute. There is no other state.

Lookups search the underlying mappings successively until a key is found. In contrast, writes, updates, and deletions only operate on the first mapping.

__abstractmethods__ = frozenset([])
__contains__(key)[source]
__copy__()

New ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]

__delitem__(key)[source]
__doc__ = u' A ChainMap groups multiple dicts (or other mappings) together\n to create a single, updateable view.\n\n The underlying mappings are stored in a list. That list is public and can\n accessed or updated using the *maps* attribute. There is no other state.\n\n Lookups search the underlying mappings successively until a key is found.\n In contrast, writes, updates, and deletions only operate on the first\n mapping.\n\n '
__getitem__(key)[source]
__init__(*maps)[source]

Initialize a ChainMap by setting maps to the given mappings. If no mappings are provided, a single empty dictionary is used.

__iter__()[source]
__len__()[source]
__missing__(key)[source]
__module__ = 'pureyaml._compat.singledispatch_helpers'
__repr__()[source]
__setitem__(key, value)[source]
_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 25
_abc_registry = <_weakrefset.WeakSet object>
clear()[source]

Clear maps[0], leaving maps[1:] intact.

copy()[source]

New ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]

classmethod fromkeys(iterable, *args)[source]

Create a ChainMap with a single dict created from the iterable.

get(key, default=None)[source]
new_child()[source]

New ChainMap with a new dict followed by all previous maps.

parents

New ChainMap from maps[1:].

pop(key, *args)[source]

Remove key from maps[0] and return its value. Raise KeyError if key not in maps[0].

popitem()[source]

Remove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.

class pureyaml._compat.singledispatch_helpers.MappingProxyType(data)[source]

Bases: UserDict.UserDict

__doc__ = None
__init__(data)[source]
__module__ = 'pureyaml._compat.singledispatch_helpers'
class pureyaml._compat.singledispatch_helpers.Support[source]

Bases: object

__dict__ = dict_proxy({'dummy': <function dummy at 0x7f1d930fdb18>, '__module__': 'pureyaml._compat.singledispatch_helpers', 'cpython_only': <function cpython_only at 0x7f1d930fdb90>, '__dict__': <attribute '__dict__' of 'Support' objects>, '__weakref__': <attribute '__weakref__' of 'Support' objects>, '__doc__': None})
__doc__ = None
__module__ = 'pureyaml._compat.singledispatch_helpers'
__weakref__

list of weak references to the object (if defined)

cpython_only(func)[source]
dummy()[source]
pureyaml._compat.singledispatch_helpers.get_cache_token()[source]
pureyaml._compat.singledispatch_helpers.recursive_repr(fillvalue=u'...')[source]

Decorator to make a repr function return fillvalue for a recursive call

pureyaml._compat.total_ordering module

Python2.7 functools.partial included for Python2.6

pureyaml._compat.total_ordering._ge_from_gt(self, other)[source]

Return a >= b. Computed by @total_ordering from (a > b) or (a == b).

pureyaml._compat.total_ordering._ge_from_le(self, other)[source]

Return a >= b. Computed by @total_ordering from (not a <= b) or (a == b).

pureyaml._compat.total_ordering._ge_from_lt(self, other)[source]

Return a >= b. Computed by @total_ordering from (not a < b).

pureyaml._compat.total_ordering._gt_from_ge(self, other)[source]

Return a > b. Computed by @total_ordering from (a >= b) and (a != b).

pureyaml._compat.total_ordering._gt_from_le(self, other)[source]

Return a > b. Computed by @total_ordering from (not a <= b).

pureyaml._compat.total_ordering._gt_from_lt(self, other)[source]

Return a > b. Computed by @total_ordering from (not a < b) and (a != b).

pureyaml._compat.total_ordering._le_from_ge(self, other)[source]

Return a <= b. Computed by @total_ordering from (not a >= b) or (a == b).

pureyaml._compat.total_ordering._le_from_gt(self, other)[source]

Return a <= b. Computed by @total_ordering from (not a > b).

pureyaml._compat.total_ordering._le_from_lt(self, other)[source]

Return a <= b. Computed by @total_ordering from (a < b) or (a == b).

pureyaml._compat.total_ordering._lt_from_ge(self, other)[source]

Return a < b. Computed by @total_ordering from (not a >= b).

pureyaml._compat.total_ordering._lt_from_gt(self, other)[source]

Return a < b. Computed by @total_ordering from (not a > b) and (a != b).

pureyaml._compat.total_ordering._lt_from_le(self, other)[source]

Return a < b. Computed by @total_ordering from (a <= b) and (a != b).

pureyaml._compat.total_ordering.total_ordering(cls)[source]

Class decorator that fills in missing ordering methods

pureyaml.grammar package

Submodules
pureyaml.grammar._parsetab module
pureyaml.grammar.productions module

Yaml grammar production rules.

class pureyaml.grammar.productions.YAMLProductions[source]

Bases: pureyaml.grammar.tokens.YAMLTokens

__doc__ = None
__module__ = 'pureyaml.grammar.productions'
p_collection(p)
collection : sequence
map
flow_collection
p_doc(p)
doc : collection
scalar
p_doc__indent(p)
doc : DOC_START doc DOC_END
DOC_START doc
INDENT doc DEDENT
p_doc_scalar_collection_ignore(p)

scalar : ignore_indent_dedent scalar

p_docs__init(p)

docs : docs doc

p_docs__last(p)
docs : doc
doc DOC_END
p_flow_collection(p)
flow_collection : F_SEQUENCE_START flow_sequence F_SEQUENCE_END
F_SEQUENCE_START flow_sequence F_SEP F_SEQUENCE_END
F_MAP_START flow_map F_MAP_END
F_MAP_START flow_map F_SEP F_MAP_END
p_flow_map__init(p)

flow_map : flow_map F_SEP flow_map_item

p_flow_map__last(p)

flow_map : flow_map_item

p_flow_map_item(p)

flow_map_item : flow_map_item_key flow_map_item_value

p_flow_map_item_key(p)

flow_map_item_key : scalar F_MAP_KEY

p_flow_map_item_value(p)

flow_map_item_value : scalar

p_flow_sequence__init(p)

flow_sequence : flow_sequence F_SEP flow_sequence_item

p_flow_sequence__last(p)

flow_sequence : flow_sequence_item

p_flow_sequence_item(p)

flow_sequence_item : scalar

p_ignore_indent_dedent(p)

ignore_indent_dedent : INDENT DEDENT

p_map__init(p)

map : map map_item

p_map__last(p)

map : map_item

p_map_item(p)

map_item : map_item_key map_item_value

p_map_item___key_value__collection(p)

map_item_key : B_MAP_KEY INDENT collection DEDENT map_item_value : B_MAP_VALUE INDENT collection DEDENT

p_map_item__compact_scalar(p)

map_item : B_MAP_COMPACT_KEY scalar B_MAP_VALUE scalar DEDENT

p_map_item__key__map_item_value__sequence_item__compact_collection(p)

map_item_key : B_MAP_COMPACT_KEY collection DEDENT map_item_value : B_MAP_COMPACT_VALUE collection DEDENT sequence_item : B_SEQUENCE_COMPACT_START collection DEDENT

p_map_item_key(p)

map_item_key : scalar

p_map_item_key__complex_key_scalar(p)

map_item_key : B_MAP_KEY scalar

p_map_item_value__flow_collection(p)

map_item_value : B_MAP_VALUE flow_collection

p_map_item_value__scalar(p)

map_item_value : B_MAP_VALUE scalar

p_map_item_value__scalar_indented(p)

map_item_value : B_MAP_VALUE INDENT scalar DEDENT

p_map_item_value__sequence_no_indent(p)

map_item_value : B_MAP_VALUE sequence

p_scalar(p)

scalar : SCALAR

p_scalar__doublequote(p)

scalar : DOUBLEQUOTE_START SCALAR DOUBLEQUOTE_END

p_scalar__explicit_cast(p)

scalar : CAST_TYPE scalar

p_scalar__folded(p)

scalar : B_FOLD_START scalar_group B_FOLD_END

p_scalar__indented_flow(p)

scalar : INDENT scalar_group DEDENT

p_scalar__literal(p)

scalar : B_LITERAL_START scalar_group B_LITERAL_END

p_scalar__quote_empty(p)
scalar : DOUBLEQUOTE_START DOUBLEQUOTE_END
SINGLEQUOTE_START SINGLEQUOTE_END
p_scalar__singlequote(p)

scalar : SINGLEQUOTE_START SCALAR SINGLEQUOTE_END

p_scalar__string_indented_multi_line(p)

scalar : scalar INDENT SCALAR DEDENT

p_scalar_group(p)
scalar_group : SCALAR
scalar_group SCALAR
p_sequence__init(p)

sequence : sequence sequence_item

p_sequence__last(p)

sequence : sequence_item

p_sequence_item__collection(p)

sequence_item : B_SEQUENCE_START INDENT collection DEDENT

p_sequence_item__flow_collection(p)

sequence_item : B_SEQUENCE_START flow_collection

p_sequence_item__scalar(p)

sequence_item : B_SEQUENCE_START scalar

pureyaml.grammar.tokens module

Yaml tokens.

class pureyaml.grammar.tokens.TokenList[source]

Bases: object

__dict__ = dict_proxy({'tokens': ['DOC_START', 'DOC_END', 'B_SEQUENCE_COMPACT_START', 'B_SEQUENCE_START', 'B_MAP_COMPACT_KEY', 'B_MAP_COMPACT_VALUE', 'B_MAP_KEY', 'B_MAP_VALUE', 'B_LITERAL_START', 'B_LITERAL_END', 'B_FOLD_START', 'B_FOLD_END', 'DOUBLEQUOTE_START', 'DOUBLEQUOTE_END', 'SINGLEQUOTE_START', 'SINGLEQUOTE_END', 'CAST_TYPE', 'SCALAR', 'INDENT', 'DEDENT', 'F_SEQUENCE_START', 'F_SEQUENCE_END', 'F_MAP_START', 'F_MAP_END', 'F_MAP_KEY', 'F_SEP'], '__dict__': <attribute '__dict__' of 'TokenList' objects>, '__module__': 'pureyaml.grammar.tokens', '__weakref__': <attribute '__weakref__' of 'TokenList' objects>, '__doc__': None})
__doc__ = None
__module__ = 'pureyaml.grammar.tokens'
__weakref__

list of weak references to the object (if defined)

tokens = ['DOC_START', 'DOC_END', 'B_SEQUENCE_COMPACT_START', 'B_SEQUENCE_START', 'B_MAP_COMPACT_KEY', 'B_MAP_COMPACT_VALUE', 'B_MAP_KEY', 'B_MAP_VALUE', 'B_LITERAL_START', 'B_LITERAL_END', 'B_FOLD_START', 'B_FOLD_END', 'DOUBLEQUOTE_START', 'DOUBLEQUOTE_END', 'SINGLEQUOTE_START', 'SINGLEQUOTE_END', 'CAST_TYPE', 'SCALAR', 'INDENT', 'DEDENT', 'F_SEQUENCE_START', 'F_SEQUENCE_END', 'F_MAP_START', 'F_MAP_END', 'F_MAP_KEY', 'F_SEP']
pureyaml.grammar.utils module
pureyaml.grammar.utils.find_column(t)[source]

Get cursor position, based on previous newline

class pureyaml.grammar.utils.fold[source]

Bases: object

Properly clean fold text.

__dict__ = dict_proxy({'__module__': 'pureyaml.grammar.utils', '__new__': <staticmethod object at 0x7f1d931227c0>, '_re_fold_replace': <_sre.SRE_Pattern object at 0x7f1d93808e40>, '_fold_replace': <classmethod object at 0x7f1d93122788>, '__dict__': <attribute '__dict__' of 'fold' objects>, '__weakref__': <attribute '__weakref__' of 'fold' objects>, '__doc__': 'Properly clean ``fold`` text.'})
__doc__ = 'Properly clean ``fold`` text.'
__module__ = 'pureyaml.grammar.utils'
static __new__(text)[source]
__weakref__

list of weak references to the object (if defined)

classmethod _fold_replace(match)[source]
_re_fold_replace = <_sre.SRE_Pattern object>
pureyaml.grammar.utils.rollback_lexpos(t)[source]
pureyaml.grammar.utils.strict(*types)[source]

Decorator, type check production rule output

pureyaml.ply package

Submodules
pureyaml.ply.cpp module
pureyaml.ply.cpp.CPP_INTEGER(t)[source]

(((((0x)|(0X))[0-9a-fA-F]+)|(d+))([uU][lL]|[lL][uU]|[uU]|[lL])?)

class pureyaml.ply.cpp.Macro(name, value, arglist=None, variadic=False)[source]

Bases: object

__dict__ = dict_proxy({'__dict__': <attribute '__dict__' of 'Macro' objects>, '__module__': 'pureyaml.ply.cpp', '__weakref__': <attribute '__weakref__' of 'Macro' objects>, '__doc__': None, '__init__': <function __init__ at 0x7f1d906f3848>})
__doc__ = None
__init__(name, value, arglist=None, variadic=False)[source]
__module__ = 'pureyaml.ply.cpp'
__weakref__

list of weak references to the object (if defined)

class pureyaml.ply.cpp.Preprocessor(lexer=None)[source]

Bases: object

__dict__ = dict_proxy({'__module__': 'pureyaml.ply.cpp', 'add_path': <function add_path at 0x7f1d906f35f0>, 'error': <function error at 0x7f1d906f3500>, 'macro_expand_args': <function macro_expand_args at 0x7f1d906f3c80>, 'lexprobe': <function lexprobe at 0x7f1d906f3f50>, 'parse': <function parse at 0x7f1d907352a8>, 'undef': <function undef at 0x7f1d90735230>, '__dict__': <attribute '__dict__' of 'Preprocessor' objects>, 'collect_args': <function collect_args at 0x7f1d906f32a8>, '__weakref__': <attribute '__weakref__' of 'Preprocessor' objects>, '__init__': <function __init__ at 0x7f1d906f37d0>, 'parsegen': <function parsegen at 0x7f1d907350c8>, 'evalexpr': <function evalexpr at 0x7f1d90735050>, 'expand_macros': <function expand_macros at 0x7f1d906f3d70>, 'macro_prescan': <function macro_prescan at 0x7f1d906f3c08>, 'tokenstrip': <function tokenstrip at 0x7f1d906f36e0>, 'token': <function token at 0x7f1d90735320>, 'tokenize': <function tokenize at 0x7f1d906f3b90>, 'include': <function include at 0x7f1d90735140>, '__doc__': None, 'group_lines': <function group_lines at 0x7f1d906f3e60>, 'define': <function define at 0x7f1d907351b8>})
__doc__ = None
__init__(lexer=None)[source]
__module__ = 'pureyaml.ply.cpp'
__weakref__

list of weak references to the object (if defined)

add_path(path)[source]
collect_args(tokenlist)[source]
define(tokens)[source]
error(file, line, msg)[source]
evalexpr(tokens)[source]
expand_macros(tokens, expanded=None)[source]
group_lines(input)[source]
include(tokens)[source]
lexprobe()[source]
macro_expand_args(macro, args)[source]
macro_prescan(macro)[source]
parse(input, source=None, ignore={})[source]
parsegen(input, source=None)[source]
token()[source]
tokenize(text)[source]
tokenstrip(tokens)[source]
undef(tokens)[source]
pureyaml.ply.cpp.t_CPP_CHAR(t)[source]

(L)?’([^\n]|(\(.|n)))*?’

pureyaml.ply.cpp.t_CPP_COMMENT1(t)[source]

(/*(.|n)*?*/)

pureyaml.ply.cpp.t_CPP_COMMENT2(t)[source]

(//.*?(n|$))

pureyaml.ply.cpp.t_CPP_INTEGER(t)

(((((0x)|(0X))[0-9a-fA-F]+)|(d+))([uU][lL]|[lL][uU]|[uU]|[lL])?)

pureyaml.ply.cpp.t_CPP_STRING(t)[source]

“([^\n]|(\(.|n)))*?”

pureyaml.ply.cpp.t_CPP_WS(t)[source]

s+

pureyaml.ply.cpp.t_error(t)[source]
pureyaml.ply.cpp.trigraph(input)[source]
pureyaml.ply.ctokens module
pureyaml.ply.ctokens.t_COMMENT(t)[source]

/*(.|n)*?*/

pureyaml.ply.ctokens.t_CPPCOMMENT(t)[source]

//.*n

pureyaml.ply.lex module
exception pureyaml.ply.lex.LexError(message, s)[source]

Bases: exceptions.Exception

__doc__ = None
__init__(message, s)[source]
__module__ = 'pureyaml.ply.lex'
__weakref__

list of weak references to the object (if defined)

class pureyaml.ply.lex.LexToken[source]

Bases: object

__dict__ = dict_proxy({'__module__': 'pureyaml.ply.lex', '__str__': <function __str__ at 0x7f1d930b0500>, '__repr__': <function __repr__ at 0x7f1d930b0578>, '__dict__': <attribute '__dict__' of 'LexToken' objects>, '__weakref__': <attribute '__weakref__' of 'LexToken' objects>, '__doc__': None})
__doc__ = None
__module__ = 'pureyaml.ply.lex'
__repr__()[source]
__str__()[source]
__weakref__

list of weak references to the object (if defined)

class pureyaml.ply.lex.Lexer[source]
__doc__ = None
__init__()[source]
__iter__()[source]
__module__ = 'pureyaml.ply.lex'
__next__()
begin(state)[source]
clone(object=None)[source]
current_state()[source]
input(s)[source]
next()[source]
pop_state()[source]
push_state(state)[source]
readtab(tabfile, fdict)[source]
skip(n)[source]
token()[source]
writetab(lextab, outputdir='')[source]
class pureyaml.ply.lex.LexerReflect(ldict, log=None, reflags=0)[source]

Bases: object

__dict__ = dict_proxy({'__module__': 'pureyaml.ply.lex', 'get_states': <function get_states at 0x7f1d930be578>, 'validate_tokens': <function validate_tokens at 0x7f1d930be410>, 'get_rules': <function get_rules at 0x7f1d930be5f0>, 'validate_all': <function validate_all at 0x7f1d930be320>, 'get_all': <function get_all at 0x7f1d930be2a8>, 'validate_module': <function validate_module at 0x7f1d930be6e0>, 'get_literals': <function get_literals at 0x7f1d930be488>, '__dict__': <attribute '__dict__' of 'LexerReflect' objects>, 'validate_literals': <function validate_literals at 0x7f1d930be500>, 'get_tokens': <function get_tokens at 0x7f1d930be398>, 'validate_rules': <function validate_rules at 0x7f1d930be668>, '__weakref__': <attribute '__weakref__' of 'LexerReflect' objects>, '__doc__': None, '__init__': <function __init__ at 0x7f1d930be230>})
__doc__ = None
__init__(ldict, log=None, reflags=0)[source]
__module__ = 'pureyaml.ply.lex'
__weakref__

list of weak references to the object (if defined)

get_all()[source]
get_literals()[source]
get_rules()[source]
get_states()[source]
get_tokens()[source]
validate_all()[source]
validate_literals()[source]
validate_module(module)[source]
validate_rules()[source]
validate_tokens()[source]
class pureyaml.ply.lex.NullLogger[source]

Bases: object

__call__(*args, **kwargs)[source]
__dict__ = dict_proxy({'__module__': 'pureyaml.ply.lex', '__getattribute__': <function __getattribute__ at 0x7f1d930b07d0>, '__dict__': <attribute '__dict__' of 'NullLogger' objects>, '__call__': <function __call__ at 0x7f1d930b0848>, '__weakref__': <attribute '__weakref__' of 'NullLogger' objects>, '__doc__': None})
__doc__ = None
__getattribute__(name)[source]
__module__ = 'pureyaml.ply.lex'
__weakref__

list of weak references to the object (if defined)

class pureyaml.ply.lex.PlyLogger(f)[source]

Bases: object

__dict__ = dict_proxy({'info': <function critical at 0x7f1d930b0668>, '__dict__': <attribute '__dict__' of 'PlyLogger' objects>, '__module__': 'pureyaml.ply.lex', 'critical': <function critical at 0x7f1d930b0668>, 'error': <function error at 0x7f1d930b0758>, 'debug': <function critical at 0x7f1d930b0668>, '__weakref__': <attribute '__weakref__' of 'PlyLogger' objects>, 'warning': <function warning at 0x7f1d930b06e0>, '__doc__': None, '__init__': <function __init__ at 0x7f1d930b05f0>})
__doc__ = None
__init__(f)[source]
__module__ = 'pureyaml.ply.lex'
__weakref__

list of weak references to the object (if defined)

critical(msg, *args, **kwargs)[source]
debug(msg, *args, **kwargs)
error(msg, *args, **kwargs)[source]
info(msg, *args, **kwargs)
warning(msg, *args, **kwargs)[source]
pureyaml.ply.lex.TOKEN(r)[source]
pureyaml.ply.lex.Token(r)
pureyaml.ply.lex._form_master_re(relist, reflags, ldict, toknames)[source]
pureyaml.ply.lex._funcs_to_names(funclist, namelist)[source]
pureyaml.ply.lex._get_regex(func)[source]
pureyaml.ply.lex._names_to_funcs(namelist, fdict)[source]
pureyaml.ply.lex._statetoken(s, names)[source]
pureyaml.ply.lex.get_caller_module_dict(levels)[source]
pureyaml.ply.lex.lex(module=None, object=None, debug=False, optimize=False, lextab='lextab', reflags=0, nowarn=False, outputdir=None, debuglog=None, errorlog=None)[source]
pureyaml.ply.lex.runmain(lexer=None, data=None)[source]
pureyaml.ply.yacc module
class pureyaml.ply.yacc.Grammar(terminals)[source]

Bases: object

__dict__ = dict_proxy({'__module__': 'pureyaml.ply.yacc', 'unused_precedence': <function unused_precedence at 0x7f1d930dec80>, '__getitem__': <function __getitem__ at 0x7f1d930de848>, 'add_production': <function add_production at 0x7f1d930de938>, 'set_start': <function set_start at 0x7f1d930de9b0>, 'compute_first': <function compute_first at 0x7f1d930ded70>, '__dict__': <attribute '__dict__' of 'Grammar' objects>, '__weakref__': <attribute '__weakref__' of 'Grammar' objects>, '__init__': <function __init__ at 0x7f1d930de758>, '_first': <function _first at 0x7f1d930decf8>, 'find_unreachable': <function find_unreachable at 0x7f1d930dea28>, 'unused_terminals': <function unused_terminals at 0x7f1d930deb90>, 'set_precedence': <function set_precedence at 0x7f1d930de8c0>, 'compute_follow': <function compute_follow at 0x7f1d930dede8>, 'unused_rules': <function unused_rules at 0x7f1d930dec08>, 'undefined_symbols': <function undefined_symbols at 0x7f1d930deb18>, 'build_lritems': <function build_lritems at 0x7f1d930dee60>, '__doc__': None, '__len__': <function __len__ at 0x7f1d930de7d0>, 'infinite_cycles': <function infinite_cycles at 0x7f1d930deaa0>})
__doc__ = None
__getitem__(index)[source]
__init__(terminals)[source]
__len__()[source]
__module__ = 'pureyaml.ply.yacc'
__weakref__

list of weak references to the object (if defined)

_first(beta)[source]
add_production(prodname, syms, func=None, file='', line=0)[source]
build_lritems()[source]
compute_first()[source]
compute_follow(start=None)[source]
find_unreachable()[source]
infinite_cycles()[source]
set_precedence(term, assoc, level)[source]
set_start(start=None)[source]
undefined_symbols()[source]
unused_precedence()[source]
unused_rules()[source]
unused_terminals()[source]
exception pureyaml.ply.yacc.GrammarError[source]

Bases: pureyaml.ply.yacc.YaccError

__doc__ = None
__module__ = 'pureyaml.ply.yacc'
exception pureyaml.ply.yacc.LALRError[source]

Bases: pureyaml.ply.yacc.YaccError

__doc__ = None
__module__ = 'pureyaml.ply.yacc'
class pureyaml.ply.yacc.LRGeneratedTable(grammar, method='LALR', log=None)[source]

Bases: pureyaml.ply.yacc.LRTable

__doc__ = None
__init__(grammar, method='LALR', log=None)[source]
__module__ = 'pureyaml.ply.yacc'
add_lalr_lookaheads(C)[source]
add_lookaheads(lookbacks, followset)[source]
compute_follow_sets(ntrans, readsets, inclsets)[source]
compute_lookback_includes(C, trans, nullable)[source]
compute_nullable_nonterminals()[source]
compute_read_sets(C, ntrans, nullable)[source]
dr_relation(C, trans, nullable)[source]
find_nonterminal_transitions(C)[source]
lr0_closure(I)[source]
lr0_goto(I, x)[source]
lr0_items()[source]
lr_parse_table()[source]
pickle_table(filename, signature='')[source]
reads_relation(C, trans, empty)[source]
write_table(tabmodule, outputdir='', signature='')[source]
class pureyaml.ply.yacc.LRItem(p, n)[source]

Bases: object

__dict__ = dict_proxy({'__module__': 'pureyaml.ply.yacc', '__str__': <function __str__ at 0x7f1d930de5f0>, '__repr__': <function __repr__ at 0x7f1d930de668>, '__dict__': <attribute '__dict__' of 'LRItem' objects>, '__weakref__': <attribute '__weakref__' of 'LRItem' objects>, '__doc__': None, '__init__': <function __init__ at 0x7f1d930de578>})
__doc__ = None
__init__(p, n)[source]
__module__ = 'pureyaml.ply.yacc'
__repr__()[source]
__str__()[source]
__weakref__

list of weak references to the object (if defined)

class pureyaml.ply.yacc.LRParser(lrtab, errorf)[source]
__doc__ = None
__init__(lrtab, errorf)[source]
__module__ = 'pureyaml.ply.yacc'
disable_defaulted_states()[source]
errok()[source]
parse(input=None, lexer=None, debug=False, tracking=False, tokenfunc=None)[source]
parsedebug(input=None, lexer=None, debug=False, tracking=False, tokenfunc=None)[source]
parseopt(input=None, lexer=None, debug=False, tracking=False, tokenfunc=None)[source]
parseopt_notrack(input=None, lexer=None, debug=False, tracking=False, tokenfunc=None)[source]
restart()[source]
set_defaulted_states()[source]
class pureyaml.ply.yacc.LRTable[source]

Bases: object

__dict__ = dict_proxy({'__module__': 'pureyaml.ply.yacc', 'read_pickle': <function read_pickle at 0x7f1d930df050>, '__doc__': None, 'read_table': <function read_table at 0x7f1d930def50>, '__dict__': <attribute '__dict__' of 'LRTable' objects>, '__weakref__': <attribute '__weakref__' of 'LRTable' objects>, 'bind_callables': <function bind_callables at 0x7f1d930df0c8>, '__init__': <function __init__ at 0x7f1d930deed8>})
__doc__ = None
__init__()[source]
__module__ = 'pureyaml.ply.yacc'
__weakref__

list of weak references to the object (if defined)

bind_callables(pdict)[source]
read_pickle(filename)[source]
read_table(module)[source]
class pureyaml.ply.yacc.MiniProduction(str, name, len, func, file, line)[source]

Bases: object

__dict__ = dict_proxy({'__module__': 'pureyaml.ply.yacc', 'bind': <function bind at 0x7f1d930de500>, '__str__': <function __str__ at 0x7f1d930de410>, '__repr__': <function __repr__ at 0x7f1d930de488>, '__dict__': <attribute '__dict__' of 'MiniProduction' objects>, '__weakref__': <attribute '__weakref__' of 'MiniProduction' objects>, '__doc__': None, '__init__': <function __init__ at 0x7f1d930de398>})
__doc__ = None
__init__(str, name, len, func, file, line)[source]
__module__ = 'pureyaml.ply.yacc'
__repr__()[source]
__str__()[source]
__weakref__

list of weak references to the object (if defined)

bind(pdict)[source]
class pureyaml.ply.yacc.NullLogger[source]

Bases: object

__call__(*args, **kwargs)[source]
__dict__ = dict_proxy({'__module__': 'pureyaml.ply.yacc', '__getattribute__': <function __getattribute__ at 0x7f1d930dc140>, '__dict__': <attribute '__dict__' of 'NullLogger' objects>, '__call__': <function __call__ at 0x7f1d930dc1b8>, '__weakref__': <attribute '__weakref__' of 'NullLogger' objects>, '__doc__': None})
__doc__ = None
__getattribute__(name)[source]
__module__ = 'pureyaml.ply.yacc'
__weakref__

list of weak references to the object (if defined)

class pureyaml.ply.yacc.ParserReflect(pdict, log=None)[source]

Bases: object

__dict__ = dict_proxy({'validate_precedence': <function validate_precedence at 0x7f1d930e00c8>, 'validate_modules': <function validate_modules at 0x7f1d930dfc80>, 'validate_error_func': <function validate_error_func at 0x7f1d930dfe60>, 'validate_all': <function validate_all at 0x7f1d930dfb90>, 'get_all': <function get_all at 0x7f1d930dfb18>, 'signature': <function signature at 0x7f1d930dfc08>, '__module__': 'pureyaml.ply.yacc', 'validate_pfunctions': <function validate_pfunctions at 0x7f1d930e01b8>, '__dict__': <attribute '__dict__' of 'ParserReflect' objects>, '__weakref__': <attribute '__weakref__' of 'ParserReflect' objects>, '__init__': <function __init__ at 0x7f1d930dfaa0>, 'validate_tokens': <function validate_tokens at 0x7f1d930dff50>, 'validate_start': <function validate_start at 0x7f1d930dfd70>, 'get_start': <function get_start at 0x7f1d930dfcf8>, 'get_pfunctions': <function get_pfunctions at 0x7f1d930e0140>, 'get_tokens': <function get_tokens at 0x7f1d930dfed8>, '__doc__': None, 'get_error_func': <function get_error_func at 0x7f1d930dfde8>, 'get_precedence': <function get_precedence at 0x7f1d930e0050>})
__doc__ = None
__init__(pdict, log=None)[source]
__module__ = 'pureyaml.ply.yacc'
__weakref__

list of weak references to the object (if defined)

get_all()[source]
get_error_func()[source]
get_pfunctions()[source]
get_precedence()[source]
get_start()[source]
get_tokens()[source]
signature()[source]
validate_all()[source]
validate_error_func()[source]
validate_modules()[source]
validate_pfunctions()[source]
validate_precedence()[source]
validate_start()[source]
validate_tokens()[source]
class pureyaml.ply.yacc.PlyLogger(f)[source]

Bases: object

__dict__ = dict_proxy({'info': <function debug at 0x7f1d930bef50>, '__dict__': <attribute '__dict__' of 'PlyLogger' objects>, '__module__': 'pureyaml.ply.yacc', 'warning': <function warning at 0x7f1d930dc050>, 'critical': <function debug at 0x7f1d930bef50>, 'error': <function error at 0x7f1d930dc0c8>, 'debug': <function debug at 0x7f1d930bef50>, '__weakref__': <attribute '__weakref__' of 'PlyLogger' objects>, '__doc__': None, '__init__': <function __init__ at 0x7f1d930beed8>})
__doc__ = None
__init__(f)[source]
__module__ = 'pureyaml.ply.yacc'
__weakref__

list of weak references to the object (if defined)

critical(msg, *args, **kwargs)
debug(msg, *args, **kwargs)[source]
error(msg, *args, **kwargs)[source]
info(msg, *args, **kwargs)
warning(msg, *args, **kwargs)[source]
class pureyaml.ply.yacc.Production(number, name, prod, precedence=('right', 0), func=None, file='', line=0)[source]

Bases: object

__dict__ = dict_proxy({'__module__': 'pureyaml.ply.yacc', '__nonzero__': <function __nonzero__ at 0x7f1d930de1b8>, '__getitem__': <function __getitem__ at 0x7f1d930de230>, 'lr_item': <function lr_item at 0x7f1d930de2a8>, 'bind': <function bind at 0x7f1d930de320>, '__str__': <function __str__ at 0x7f1d930de050>, '__doc__': None, '__len__': <function __len__ at 0x7f1d930de140>, '__dict__': <attribute '__dict__' of 'Production' objects>, '__weakref__': <attribute '__weakref__' of 'Production' objects>, 'reduced': 0, '__init__': <function __init__ at 0x7f1d930dcf50>, '__repr__': <function __repr__ at 0x7f1d930de0c8>})
__doc__ = None
__getitem__(index)[source]
__init__(number, name, prod, precedence=('right', 0), func=None, file='', line=0)[source]
__len__()[source]
__module__ = 'pureyaml.ply.yacc'
__nonzero__()[source]
__repr__()[source]
__str__()[source]
__weakref__

list of weak references to the object (if defined)

bind(pdict)[source]
lr_item(n)[source]
reduced = 0
exception pureyaml.ply.yacc.VersionError[source]

Bases: pureyaml.ply.yacc.YaccError

__doc__ = None
__module__ = 'pureyaml.ply.yacc'
exception pureyaml.ply.yacc.YaccError[source]

Bases: exceptions.Exception

__doc__ = None
__module__ = 'pureyaml.ply.yacc'
__weakref__

list of weak references to the object (if defined)

class pureyaml.ply.yacc.YaccProduction(s, stack=None)[source]
__doc__ = None
__getitem__(n)[source]
__getslice__(i, j)[source]
__init__(s, stack=None)[source]
__len__()[source]
__module__ = 'pureyaml.ply.yacc'
__setitem__(n, v)[source]
error()[source]
lexpos(n)[source]
lexspan(n)[source]
lineno(n)[source]
linespan(n)[source]
set_lineno(n, lineno)[source]
class pureyaml.ply.yacc.YaccSymbol[source]
__doc__ = None
__module__ = 'pureyaml.ply.yacc'
__repr__()[source]
__str__()[source]
pureyaml.ply.yacc.call_errorfunc(errorfunc, token, parser)[source]
pureyaml.ply.yacc.digraph(X, R, FP)[source]
pureyaml.ply.yacc.errok()[source]
pureyaml.ply.yacc.format_result(r)[source]
pureyaml.ply.yacc.format_stack_entry(r)[source]
pureyaml.ply.yacc.get_caller_module_dict(levels)[source]
pureyaml.ply.yacc.parse_grammar(doc, file, line)[source]
pureyaml.ply.yacc.restart()[source]
pureyaml.ply.yacc.rightmost_terminal(symbols, terminals)[source]
pureyaml.ply.yacc.token()[source]
pureyaml.ply.yacc.traverse(x, N, stack, F, X, R, FP)[source]
pureyaml.ply.yacc.yacc(method='LALR', debug=True, module=None, tabmodule='parsetab', start=None, check_recursion=True, optimize=False, write_tables=True, debugfile='parser.out', outputdir=None, debuglog=None, errorlog=None, picklefile=None)[source]
pureyaml.ply.ygen module
pureyaml.ply.ygen.filter_section(lines, tag)[source]
pureyaml.ply.ygen.get_source_range(lines, tag)[source]
pureyaml.ply.ygen.main()[source]

Submodules

pureyaml.decoder module

class pureyaml.decoder.YAMLDecoder(*args, **kwargs)[source]

Bases: pureyaml.nodes.NodeVisitor

Convert node tree into python object.

__doc__ = 'Convert node tree into python object.'
__module__ = 'pureyaml.decoder'
decode(s)[source]
visit_Binary(node)[source]
visit_Bool(node)
visit_Doc(node)
visit_Docs(node)[source]
visit_Float(node)
visit_Int(node)
visit_Map(node)[source]
visit_Null(_)[source]
visit_Scalar(node)[source]
visit_Sequence(node)[source]
visit_Str(node)

pureyaml.encoder module

class pureyaml.encoder.SYMBOL(name)[source]
__doc__ = None
__init__(name)[source]
__module__ = 'pureyaml.encoder'
__repr__()[source]
class pureyaml.encoder.YAMLEncoder(indent=None, sort_keys=None, **kw)[source]

Bases: pureyaml.nodes.NodeVisitor

Convert node tree into string.

__doc__ = 'Convert node tree into string.'
__init__(indent=None, sort_keys=None, **kw)[source]
__module__ = 'pureyaml.encoder'
_encode(obj)[source]
encode(obj)[source]
iter_map_items(node)[source]
iterencode(obj)[source]
stack = []
visit_Binary(node)[source]
visit_Bool(node)[source]
visit_Float(node)[source]
visit_Int(node)
visit_Map(node)[source]
visit_Null(node)[source]
visit_Scalar(node)[source]
visit_Sequence(node)[source]
visit_Str(node)[source]
pureyaml.encoder._(obj)[source]
pureyaml.encoder.is_float(string)[source]
pureyaml.encoder.node_encoder(*args, **kw)[source]

Convert python object to node tree.

pureyaml.exceptions module

exception pureyaml.exceptions.YAMLCastTypeError(message=None, cast=None)[source]

Bases: exceptions.TypeError, pureyaml.exceptions.YAMLException

__doc__ = None
__init__(message=None, cast=None)[source]
__module__ = 'pureyaml.exceptions'
__weakref__

list of weak references to the object (if defined)

exception pureyaml.exceptions.YAMLException(message)[source]

Bases: exceptions.Exception

Base exception for package

__doc__ = 'Base exception for package'
__init__(message)[source]
__module__ = 'pureyaml.exceptions'
__str__()[source]
__weakref__

list of weak references to the object (if defined)

exception pureyaml.exceptions.YAMLStrictTypeError(token, types, func)[source]

Bases: exceptions.TypeError, pureyaml.exceptions.YAMLException

__doc__ = None
__init__(token, types, func)[source]
__module__ = 'pureyaml.exceptions'
__str__()[source]
__weakref__

list of weak references to the object (if defined)

exception pureyaml.exceptions.YAMLSyntaxError(p, value=None)[source]

Bases: exceptions.SyntaxError, pureyaml.exceptions.YAMLException

__doc__ = None
__init__(p, value=None)[source]
__module__ = 'pureyaml.exceptions'
__str__()[source]
__weakref__

list of weak references to the object (if defined)

msg_lines()[source]
exception pureyaml.exceptions.YAMLUnknownSyntaxError[source]

Bases: exceptions.SyntaxError, pureyaml.exceptions.YAMLException

Unexpected syntax error

__doc__ = 'Unexpected syntax error'
__module__ = 'pureyaml.exceptions'
__weakref__

list of weak references to the object (if defined)

pureyaml.nodes module

Node definitions for intermediary node tree.

class pureyaml.nodes.Node(value, **kwargs)[source]

Bases: object

__dict__ = dict_proxy({'__ne__': <function __ne__ at 0x7f1d93109578>, '__module__': 'pureyaml.nodes', '__ge__': <function __ge__ at 0x7f1d931099b0>, '__weakref__': <attribute '__weakref__' of 'Node' objects>, 'repr_value': <function repr_value at 0x7f1d931095f0>, 'init_value': <function init_value at 0x7f1d93109410>, '__le__': <function __le__ at 0x7f1d93109a28>, '__repr__': <function __repr__ at 0x7f1d93109668>, '__gt__': <function __gt__ at 0x7f1d93109500>, '__dict__': <attribute '__dict__' of 'Node' objects>, '__lt__': <function __lt__ at 0x7f1d93109938>, '__eq__': <function __eq__ at 0x7f1d93109488>, '__doc__': None, '__init__': <function __init__ at 0x7f1d93109398>})
__doc__ = None
__eq__(other)[source]
__ge__(other)

x.__ge__(y) <==> x>=y

__gt__(other)[source]
__init__(value, **kwargs)[source]
__le__(other)

x.__le__(y) <==> x<=y

__lt__(other)

x.__lt__(y) <==> x<y

__module__ = 'pureyaml.nodes'
__ne__(other)[source]
__repr__()[source]
__weakref__

list of weak references to the object (if defined)

init_value(*values, **kwargs)[source]
repr_value(value)[source]
class pureyaml.nodes.Collection(*values, **kwargs)[source]

Bases: pureyaml.nodes.SequenceMixin, pureyaml.nodes.Node

__abstractmethods__ = frozenset([])
__add__(other)
__doc__ = None
__init__(*values, **kwargs)
__module__ = 'pureyaml.nodes'
_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 25
_abc_registry = <_weakrefset.WeakSet object>
init_value(*value, **kwargs)
class pureyaml.nodes.Docs(*values, **kwargs)[source]

Bases: pureyaml.nodes.Collection

__abstractmethods__ = frozenset([])
__doc__ = None
__module__ = 'pureyaml.nodes'
_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 25
_abc_registry = <_weakrefset.WeakSet object>
class pureyaml.nodes.Doc(*values, **kwargs)[source]

Bases: pureyaml.nodes.Collection

__abstractmethods__ = frozenset([])
__doc__ = None
__module__ = 'pureyaml.nodes'
_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 25
_abc_registry = <_weakrefset.WeakSet object>
class pureyaml.nodes.Sequence(*values, **kwargs)[source]

Bases: pureyaml.nodes.Collection

__abstractmethods__ = frozenset([])
__doc__ = None
__module__ = 'pureyaml.nodes'
_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 25
_abc_registry = <_weakrefset.WeakSet object>
class pureyaml.nodes.Map(*args, **kwargs)[source]

Bases: pureyaml.nodes.MappingMixin, pureyaml.nodes.Collection

__abstractmethods__ = frozenset([])
__doc__ = None
__eq__(other)[source]
__module__ = 'pureyaml.nodes'
_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 25
_abc_registry = <_weakrefset.WeakSet object>
init_value(*values, **kwargs)[source]
class pureyaml.nodes.Scalar(value, *args, **kwargs)[source]

Bases: pureyaml.nodes.Node

__doc__ = None
__eq__(other)[source]
__gt__(other)[source]
__init__(value, *args, **kwargs)[source]
__len__()[source]
__module__ = 'pureyaml.nodes'
init_value(value, *args, **kwargs)[source]
type = NotImplemented
class pureyaml.nodes.Null(value, *args, **kwargs)[source]

Bases: pureyaml.nodes.Scalar

__doc__ = None
__module__ = 'pureyaml.nodes'
init_value(*values, **kwargs)[source]
type = None
class pureyaml.nodes.Str(value, *args, **kwargs)[source]

Bases: pureyaml.nodes.Scalar

__doc__ = None
__module__ = 'pureyaml.nodes'
init_value(value, *args, **kwargs)[source]
type

alias of str

class pureyaml.nodes.Int(value, *args, **kwargs)[source]

Bases: pureyaml.nodes.Scalar

__doc__ = None
__module__ = 'pureyaml.nodes'
init_value(value, base=None, *args, **kwargs)[source]
type

alias of int

class pureyaml.nodes.Float(value, *args, **kwargs)[source]

Bases: pureyaml.nodes.Scalar

__doc__ = None
__eq__(other)[source]
__module__ = 'pureyaml.nodes'
init_value(value, *args, **kwargs)[source]
type

alias of float

class pureyaml.nodes.Bool(value, *args, **kwargs)[source]

Bases: pureyaml.nodes.Scalar

FALSE_VALUES = ['FALSE', 'NO', '0']
TRUE_VALUES = ['TRUE', 'YES', '1']
__doc__ = None
__module__ = 'pureyaml.nodes'
init_value(value, *args, **kwargs)[source]
type

alias of bool

class pureyaml.nodes.Binary(value, *args, **kwargs)[source]

Bases: pureyaml.nodes.Scalar

__doc__ = None
__module__ = 'pureyaml.nodes'
classmethod from_decoded(data)[source]
init_value(value, *args, **kwargs)[source]
type = 'binary'
class pureyaml.nodes.ScalarDispatch[source]

Bases: object

__dict__ = dict_proxy({'map': {'int16': <functools.partial object at 0x7f1d9310baa0>, 'infinity': <class 'pureyaml.nodes.Float'>, 'int10': <functools.partial object at 0x7f1d9310b9f0>, 'int': <class 'pureyaml.nodes.Int'>, 'float': <class 'pureyaml.nodes.Float'>, 'null': <class 'pureyaml.nodes.Null'>, 'int8': <functools.partial object at 0x7f1d9310ba48>, 'binary': <class 'pureyaml.nodes.Binary'>, 'nan': <class 'pureyaml.nodes.Float'>, 'bool': <class 'pureyaml.nodes.Bool'>, 'str': <class 'pureyaml.nodes.Str'>}, '__module__': 'pureyaml.nodes', '__new__': <staticmethod object at 0x7f1d930fb980>, 're_dispatch': <_sre.SRE_Pattern object at 0x1f32530>, '__dict__': <attribute '__dict__' of 'ScalarDispatch' objects>, '__weakref__': <attribute '__weakref__' of 'ScalarDispatch' objects>, '__doc__': None})
__doc__ = None
__module__ = 'pureyaml.nodes'
static __new__(value, cast=None)[source]
__weakref__

list of weak references to the object (if defined)

map = {'int16': <functools.partial object at 0x7f1d9310baa0>, 'infinity': <class 'pureyaml.nodes.Float'>, 'int10': <functools.partial object at 0x7f1d9310b9f0>, 'int': <class 'pureyaml.nodes.Int'>, 'float': <class 'pureyaml.nodes.Float'>, 'null': <class 'pureyaml.nodes.Null'>, 'int8': <functools.partial object at 0x7f1d9310ba48>, 'binary': <class 'pureyaml.nodes.Binary'>, 'nan': <class 'pureyaml.nodes.Float'>, 'bool': <class 'pureyaml.nodes.Bool'>, 'str': <class 'pureyaml.nodes.Str'>}
re_dispatch = <_sre.SRE_Pattern object at 0x1f32530>
class pureyaml.nodes.NodeVisitor(*args, **kwargs)[source]

Bases: object

__dict__ = dict_proxy({'__module__': 'pureyaml.nodes', '_visit': <function _visit at 0x7f1d931102a8>, 'visit': <function visit at 0x7f1d93110230>, '__doc__': None, '__dict__': <attribute '__dict__' of 'NodeVisitor' objects>, '__weakref__': <attribute '__weakref__' of 'NodeVisitor' objects>, 'generic_visit': <function generic_visit at 0x7f1d93110320>, '__init__': <function __init__ at 0x7f1d931101b8>})
__doc__ = None
__init__(*args, **kwargs)[source]
__module__ = 'pureyaml.nodes'
__weakref__

list of weak references to the object (if defined)

_visit(node)[source]
generic_visit(node)[source]
visit(node)[source]

pureyaml.parser module

Build yacc parser from lex tokens.

class pureyaml.parser.YAMLLexer[source]

Bases: pureyaml.grammar.tokens.YAMLTokens

__doc__ = None
__module__ = 'pureyaml.parser'
classmethod build(**kwargs)[source]
t_ANY_error(t)[source]
classmethod tokenize(data)[source]
class pureyaml.parser.YAMLParser(**kwargs)[source]

Bases: pureyaml.grammar.productions.YAMLProductions

__doc__ = None
__init__(**kwargs)
__module__ = 'pureyaml.parser'
p_error(p)
parse(data, **kwargs)
parsedebug(data, **kwargs)
tokenize(data)

Feedback

If you have any suggestions or questions about pureyaml feel free to email me at bionikspoon@gmail.com.

If you encounter any errors or problems with pureyaml, please let me know! Open an Issue at the GitHub https://github.com/bionikspoon/pureyaml main repository.

Indices and tables