Welcome to pureyaml’s documentation!¶
Contents:¶
pureyaml¶
Yet another yaml parser, in pure python.
Features¶
- Documentation: https://pureyaml.readthedocs.org
- Open Source: https://github.com/bionikspoon/pureyaml
- MIT license
- YAML encoder/decoder written in pure python
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.
Fork the pureyaml repo on GitHub.
Clone your fork locally:
$ git clone git@github.com:your_name_here/pureyaml.git
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
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.
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.
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
Submit a pull request through the GitHub website.
Pull Request Guidelines¶
Before you submit a pull request, check that it meets these guidelines:
- The pull request should include tests.
- 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.
- 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.
Credits¶
Development Lead¶
- Manu Phatak <bionikspoon@gmail.com>
Contributors¶
None yet. Why not be the first?
pureyaml package¶
pureyaml¶
Yet another yaml parser, in pure python.
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'¶
-
-
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 0x7f5b3bec76d0>, '__module__': '_abcoll', '__metaclass__': <class 'abc.ABCMeta'>, '_abc_registry': <_weakrefset.WeakSet object at 0x7f5b3bec7610>, '__abstractmethods__': frozenset(['__call__']), '__dict__': <attribute '__dict__' of 'Callable' objects>, '__subclasshook__': <classmethod object at 0x7f5b3beb3b78>, '_abc_negative_cache_version': 1, '_abc_negative_cache': <_weakrefset.WeakSet object at 0x7f5b3bec7750>, '__call__': <function __call__ at 0x7f5b3be1c578>, '__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 0x7f5b3bec7510>, '__module__': '_abcoll', '__metaclass__': <class 'abc.ABCMeta'>, '__contains__': <function __contains__ at 0x7f5b3be1c320>, '_abc_registry': <_weakrefset.WeakSet object at 0x7f5b3bec7450>, '__abstractmethods__': frozenset(['__contains__']), '__subclasshook__': <classmethod object at 0x7f5b3beb3b40>, '_abc_negative_cache_version': 1, '_abc_negative_cache': <_weakrefset.WeakSet object at 0x7f5b3bec7590>, '__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 0x7f5b3bec1dd0>, '__module__': '_abcoll', '__metaclass__': <class 'abc.ABCMeta'>, '_abc_registry': <_weakrefset.WeakSet object at 0x7f5b3beb79d0>, '__abstractmethods__': frozenset(['__hash__']), '__dict__': <attribute '__dict__' of 'Hashable' objects>, '__subclasshook__': <classmethod object at 0x7f5b3beb3600>, '_abc_negative_cache_version': 0, '_abc_negative_cache': <_weakrefset.WeakSet object at 0x7f5b3bec1e50>, '__hash__': <function __hash__ at 0x7f5b3bec58c0>, '__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 0x7f5b3bec1f90>, '__module__': '_abcoll', '__metaclass__': <class 'abc.ABCMeta'>, '_abc_registry': <_weakrefset.WeakSet object at 0x7f5b3bec1ed0>, '__abstractmethods__': frozenset(['__iter__']), '__iter__': <function __iter__ at 0x7f5b3bec5b18>, '__subclasshook__': <classmethod object at 0x7f5b3beb35c8>, '_abc_negative_cache_version': 0, '_abc_negative_cache': <_weakrefset.WeakSet object at 0x7f5b3bec7050>, '__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 0x7f5b3bec7350>, '__module__': '_abcoll', '__metaclass__': <class 'abc.ABCMeta'>, '_abc_registry': <_weakrefset.WeakSet object at 0x7f5b3bec7290>, '__abstractmethods__': frozenset(['__len__']), '__subclasshook__': <classmethod object at 0x7f5b3beb3b08>, '_abc_negative_cache_version': 1, '_abc_negative_cache': <_weakrefset.WeakSet object at 0x7f5b3bec73d0>, '__dict__': <attribute '__dict__' of 'Sized' objects>, '__weakref__': <attribute '__weakref__' of 'Sized' objects>, '__doc__': None, '__len__': <function __len__ at 0x7f5b3be1c0c8>})¶
-
__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'¶
-
class
-
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([])¶
-
__copy__
()¶ New ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]
-
__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 '¶
-
__init__
(*maps)[source]¶ Initialize a ChainMap by setting maps to the given mappings. If no mappings are provided, a single empty dictionary is used.
-
__module__
= 'pureyaml._compat.singledispatch_helpers'¶
-
_abc_cache
= <_weakrefset.WeakSet object>¶
-
_abc_negative_cache
= <_weakrefset.WeakSet object>¶
-
_abc_negative_cache_version
= 25¶
-
_abc_registry
= <_weakrefset.WeakSet object>¶
-
classmethod
fromkeys
(iterable, *args)[source]¶ Create a ChainMap with a single dict created from the iterable.
-
parents
¶ New ChainMap from maps[1:].
-
-
class
pureyaml._compat.singledispatch_helpers.
MappingProxyType
(data)[source]¶ Bases:
UserDict.UserDict
-
__doc__
= None¶
-
__module__
= 'pureyaml._compat.singledispatch_helpers'¶
-
-
class
pureyaml._compat.singledispatch_helpers.
Support
[source]¶ Bases:
object
-
__dict__
= dict_proxy({'dummy': <function dummy at 0x7f5b38b0bde8>, '__module__': 'pureyaml._compat.singledispatch_helpers', 'cpython_only': <function cpython_only at 0x7f5b38b0be60>, '__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)
-
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.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
- mapflow_collection
-
p_doc
(p)¶ - doc : collection
- scalar
-
p_doc__indent
(p)¶ - doc : DOC_START doc DOC_END
- DOC_START docINDENT 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_ENDF_MAP_START flow_map F_MAP_ENDF_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¶
-
class
pureyaml.grammar.utils.
fold
[source]¶ Bases:
object
Properly clean
fold
text.-
__dict__
= dict_proxy({'__module__': 'pureyaml.grammar.utils', '__new__': <staticmethod object at 0x7f5b38b2d7c0>, '_re_fold_replace': <_sre.SRE_Pattern object at 0x7f5b39216e40>, '_fold_replace': <classmethod object at 0x7f5b38b2d788>, '__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'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
_re_fold_replace
= <_sre.SRE_Pattern object>¶
-
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 0x7f5b3610e5f0>})¶
-
__doc__
= None¶
-
__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 0x7f5b361410c8>, 'error': <function error at 0x7f5b362ccc80>, 'macro_expand_args': <function macro_expand_args at 0x7f5b36141320>, 'lexprobe': <function lexprobe at 0x7f5b36141050>, 'parse': <function parse at 0x7f5b3610e320>, 'undef': <function undef at 0x7f5b3610e398>, '__dict__': <attribute '__dict__' of 'Preprocessor' objects>, 'collect_args': <function collect_args at 0x7f5b36141230>, '__weakref__': <attribute '__weakref__' of 'Preprocessor' objects>, '__init__': <function __init__ at 0x7f5b3610eed8>, 'parsegen': <function parsegen at 0x7f5b36141488>, 'evalexpr': <function evalexpr at 0x7f5b36141410>, 'expand_macros': <function expand_macros at 0x7f5b36141398>, 'macro_prescan': <function macro_prescan at 0x7f5b361412a8>, 'tokenstrip': <function tokenstrip at 0x7f5b361411b8>, 'token': <function token at 0x7f5b3610ef50>, 'tokenize': <function tokenize at 0x7f5b362cc1b8>, 'include': <function include at 0x7f5b36141500>, '__doc__': None, 'group_lines': <function group_lines at 0x7f5b36141140>, 'define': <function define at 0x7f5b36141578>})¶
-
__doc__
= None¶
-
__module__
= 'pureyaml.ply.cpp'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
pureyaml.ply.cpp.
t_CPP_INTEGER
(t)¶ (((((0x)|(0X))[0-9a-fA-F]+)|(d+))([uU][lL]|[lL][uU]|[uU]|[lL])?)
pureyaml.ply.ctokens module¶
pureyaml.ply.lex module¶
-
exception
pureyaml.ply.lex.
LexError
(message, s)[source]¶ Bases:
exceptions.Exception
-
__doc__
= None¶
-
__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 0x7f5b38abb7d0>, '__repr__': <function __repr__ at 0x7f5b38abb848>, '__dict__': <attribute '__dict__' of 'LexToken' objects>, '__weakref__': <attribute '__weakref__' of 'LexToken' objects>, '__doc__': None})¶
-
__doc__
= None¶
-
__module__
= 'pureyaml.ply.lex'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
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 0x7f5b38aca848>, 'validate_tokens': <function validate_tokens at 0x7f5b38aca6e0>, 'get_rules': <function get_rules at 0x7f5b38aca8c0>, 'validate_all': <function validate_all at 0x7f5b38aca5f0>, 'get_all': <function get_all at 0x7f5b38aca578>, 'validate_module': <function validate_module at 0x7f5b38aca9b0>, 'get_literals': <function get_literals at 0x7f5b38aca758>, '__dict__': <attribute '__dict__' of 'LexerReflect' objects>, 'validate_literals': <function validate_literals at 0x7f5b38aca7d0>, 'get_tokens': <function get_tokens at 0x7f5b38aca668>, 'validate_rules': <function validate_rules at 0x7f5b38aca938>, '__weakref__': <attribute '__weakref__' of 'LexerReflect' objects>, '__doc__': None, '__init__': <function __init__ at 0x7f5b38aca500>})¶
-
__doc__
= None¶
-
__module__
= 'pureyaml.ply.lex'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
class
pureyaml.ply.lex.
NullLogger
[source]¶ Bases:
object
-
__dict__
= dict_proxy({'__module__': 'pureyaml.ply.lex', '__getattribute__': <function __getattribute__ at 0x7f5b38abbaa0>, '__dict__': <attribute '__dict__' of 'NullLogger' objects>, '__call__': <function __call__ at 0x7f5b38abbb18>, '__weakref__': <attribute '__weakref__' of 'NullLogger' objects>, '__doc__': None})¶
-
__doc__
= None¶
-
__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 0x7f5b38abb938>, '__dict__': <attribute '__dict__' of 'PlyLogger' objects>, '__module__': 'pureyaml.ply.lex', 'critical': <function critical at 0x7f5b38abb938>, 'error': <function error at 0x7f5b38abba28>, 'debug': <function critical at 0x7f5b38abb938>, '__weakref__': <attribute '__weakref__' of 'PlyLogger' objects>, 'warning': <function warning at 0x7f5b38abb9b0>, '__doc__': None, '__init__': <function __init__ at 0x7f5b38abb8c0>})¶
-
__doc__
= None¶
-
__module__
= 'pureyaml.ply.lex'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
debug
(msg, *args, **kwargs)¶
-
info
(msg, *args, **kwargs)¶
-
-
pureyaml.ply.lex.
Token
(r)¶
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 0x7f5b38aeaf50>, '__getitem__': <function __getitem__ at 0x7f5b38aeab18>, 'add_production': <function add_production at 0x7f5b38aeac08>, 'set_start': <function set_start at 0x7f5b38aeac80>, 'compute_first': <function compute_first at 0x7f5b38aeb0c8>, '__dict__': <attribute '__dict__' of 'Grammar' objects>, '__weakref__': <attribute '__weakref__' of 'Grammar' objects>, '__init__': <function __init__ at 0x7f5b38aeaa28>, '_first': <function _first at 0x7f5b38aeb050>, 'find_unreachable': <function find_unreachable at 0x7f5b38aeacf8>, 'unused_terminals': <function unused_terminals at 0x7f5b38aeae60>, 'set_precedence': <function set_precedence at 0x7f5b38aeab90>, 'compute_follow': <function compute_follow at 0x7f5b38aeb140>, 'unused_rules': <function unused_rules at 0x7f5b38aeaed8>, 'undefined_symbols': <function undefined_symbols at 0x7f5b38aeade8>, 'build_lritems': <function build_lritems at 0x7f5b38aeb1b8>, '__doc__': None, '__len__': <function __len__ at 0x7f5b38aeaaa0>, 'infinite_cycles': <function infinite_cycles at 0x7f5b38aead70>})¶
-
__doc__
= None¶
-
__module__
= 'pureyaml.ply.yacc'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
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¶
-
__module__
= 'pureyaml.ply.yacc'¶
-
-
class
pureyaml.ply.yacc.
LRItem
(p, n)[source]¶ Bases:
object
-
__dict__
= dict_proxy({'__module__': 'pureyaml.ply.yacc', '__str__': <function __str__ at 0x7f5b38aea8c0>, '__repr__': <function __repr__ at 0x7f5b38aea938>, '__dict__': <attribute '__dict__' of 'LRItem' objects>, '__weakref__': <attribute '__weakref__' of 'LRItem' objects>, '__doc__': None, '__init__': <function __init__ at 0x7f5b38aea848>})¶
-
__doc__
= None¶
-
__module__
= 'pureyaml.ply.yacc'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
class
pureyaml.ply.yacc.
LRParser
(lrtab, errorf)[source]¶ -
__doc__
= None¶
-
__module__
= 'pureyaml.ply.yacc'¶
-
-
class
pureyaml.ply.yacc.
LRTable
[source]¶ Bases:
object
-
__dict__
= dict_proxy({'__module__': 'pureyaml.ply.yacc', 'read_pickle': <function read_pickle at 0x7f5b38aeb320>, '__doc__': None, 'read_table': <function read_table at 0x7f5b38aeb2a8>, '__dict__': <attribute '__dict__' of 'LRTable' objects>, '__weakref__': <attribute '__weakref__' of 'LRTable' objects>, 'bind_callables': <function bind_callables at 0x7f5b38aeb398>, '__init__': <function __init__ at 0x7f5b38aeb230>})¶
-
__doc__
= None¶
-
__module__
= 'pureyaml.ply.yacc'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
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 0x7f5b38aea7d0>, '__str__': <function __str__ at 0x7f5b38aea6e0>, '__repr__': <function __repr__ at 0x7f5b38aea758>, '__dict__': <attribute '__dict__' of 'MiniProduction' objects>, '__weakref__': <attribute '__weakref__' of 'MiniProduction' objects>, '__doc__': None, '__init__': <function __init__ at 0x7f5b38aea668>})¶
-
__doc__
= None¶
-
__module__
= 'pureyaml.ply.yacc'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
class
pureyaml.ply.yacc.
NullLogger
[source]¶ Bases:
object
-
__dict__
= dict_proxy({'__module__': 'pureyaml.ply.yacc', '__getattribute__': <function __getattribute__ at 0x7f5b38adb410>, '__dict__': <attribute '__dict__' of 'NullLogger' objects>, '__call__': <function __call__ at 0x7f5b38adb488>, '__weakref__': <attribute '__weakref__' of 'NullLogger' objects>, '__doc__': None})¶
-
__doc__
= None¶
-
__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 0x7f5b38aec398>, 'validate_modules': <function validate_modules at 0x7f5b38aebf50>, 'validate_error_func': <function validate_error_func at 0x7f5b38aec1b8>, 'validate_all': <function validate_all at 0x7f5b38aebe60>, 'get_all': <function get_all at 0x7f5b38aebde8>, 'signature': <function signature at 0x7f5b38aebed8>, '__module__': 'pureyaml.ply.yacc', 'validate_pfunctions': <function validate_pfunctions at 0x7f5b38aec488>, '__dict__': <attribute '__dict__' of 'ParserReflect' objects>, '__weakref__': <attribute '__weakref__' of 'ParserReflect' objects>, '__init__': <function __init__ at 0x7f5b38aebd70>, 'validate_tokens': <function validate_tokens at 0x7f5b38aec2a8>, 'validate_start': <function validate_start at 0x7f5b38aec0c8>, 'get_start': <function get_start at 0x7f5b38aec050>, 'get_pfunctions': <function get_pfunctions at 0x7f5b38aec410>, 'get_tokens': <function get_tokens at 0x7f5b38aec230>, '__doc__': None, 'get_error_func': <function get_error_func at 0x7f5b38aec140>, 'get_precedence': <function get_precedence at 0x7f5b38aec320>})¶
-
__doc__
= None¶
-
__module__
= 'pureyaml.ply.yacc'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
class
pureyaml.ply.yacc.
PlyLogger
(f)[source]¶ Bases:
object
-
__dict__
= dict_proxy({'info': <function debug at 0x7f5b38adb2a8>, '__dict__': <attribute '__dict__' of 'PlyLogger' objects>, '__module__': 'pureyaml.ply.yacc', 'warning': <function warning at 0x7f5b38adb320>, 'critical': <function debug at 0x7f5b38adb2a8>, 'error': <function error at 0x7f5b38adb398>, 'debug': <function debug at 0x7f5b38adb2a8>, '__weakref__': <attribute '__weakref__' of 'PlyLogger' objects>, '__doc__': None, '__init__': <function __init__ at 0x7f5b38adb230>})¶
-
__doc__
= None¶
-
__module__
= 'pureyaml.ply.yacc'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
critical
(msg, *args, **kwargs)¶
-
info
(msg, *args, **kwargs)¶
-
-
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 0x7f5b38aea488>, '__getitem__': <function __getitem__ at 0x7f5b38aea500>, 'lr_item': <function lr_item at 0x7f5b38aea578>, 'bind': <function bind at 0x7f5b38aea5f0>, '__str__': <function __str__ at 0x7f5b38aea320>, '__doc__': None, '__len__': <function __len__ at 0x7f5b38aea410>, '__dict__': <attribute '__dict__' of 'Production' objects>, '__weakref__': <attribute '__weakref__' of 'Production' objects>, 'reduced': 0, '__init__': <function __init__ at 0x7f5b38aea2a8>, '__repr__': <function __repr__ at 0x7f5b38aea398>})¶
-
__doc__
= None¶
-
__module__
= 'pureyaml.ply.yacc'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
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¶
-
__module__
= 'pureyaml.ply.yacc'¶
-
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'¶
-
visit_Bool
(node)¶
-
visit_Doc
(node)¶
-
visit_Float
(node)¶
-
visit_Int
(node)¶
-
visit_Str
(node)¶
-
pureyaml.encoder module¶
pureyaml.exceptions module¶
-
exception
pureyaml.exceptions.
YAMLCastTypeError
(message=None, cast=None)[source]¶ Bases:
exceptions.TypeError
,pureyaml.exceptions.YAMLException
-
__doc__
= None¶
-
__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'¶
-
__module__
= 'pureyaml.exceptions'¶
-
__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¶
-
__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 0x7f5b38b65848>, '__module__': 'pureyaml.nodes', '__ge__': <function __ge__ at 0x7f5b38b65c80>, '__weakref__': <attribute '__weakref__' of 'Node' objects>, 'repr_value': <function repr_value at 0x7f5b38b658c0>, 'init_value': <function init_value at 0x7f5b38b656e0>, '__le__': <function __le__ at 0x7f5b38b65cf8>, '__repr__': <function __repr__ at 0x7f5b38b65938>, '__gt__': <function __gt__ at 0x7f5b38b657d0>, '__dict__': <attribute '__dict__' of 'Node' objects>, '__lt__': <function __lt__ at 0x7f5b38b65c08>, '__eq__': <function __eq__ at 0x7f5b38b65758>, '__doc__': None, '__init__': <function __init__ at 0x7f5b38b65668>})¶
-
__doc__
= None¶
-
__ge__
(other)¶ x.__ge__(y) <==> x>=y
-
__le__
(other)¶ x.__le__(y) <==> x<=y
-
__lt__
(other)¶ x.__lt__(y) <==> x<y
-
__module__
= 'pureyaml.nodes'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
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¶
-
__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.
Scalar
(value, *args, **kwargs)[source]¶ Bases:
pureyaml.nodes.Node
-
__doc__
= None¶
-
__module__
= 'pureyaml.nodes'¶
-
type
= NotImplemented¶
-
-
class
pureyaml.nodes.
Null
(value, *args, **kwargs)[source]¶ Bases:
pureyaml.nodes.Scalar
-
__doc__
= None¶
-
__module__
= 'pureyaml.nodes'¶
-
type
= None¶
-
-
class
pureyaml.nodes.
Str
(value, *args, **kwargs)[source]¶ Bases:
pureyaml.nodes.Scalar
-
__doc__
= None¶
-
__module__
= 'pureyaml.nodes'¶
-
type
¶ alias of
str
-
-
class
pureyaml.nodes.
Int
(value, *args, **kwargs)[source]¶ Bases:
pureyaml.nodes.Scalar
-
__doc__
= None¶
-
__module__
= 'pureyaml.nodes'¶
-
type
¶ alias of
int
-
-
class
pureyaml.nodes.
Float
(value, *args, **kwargs)[source]¶ Bases:
pureyaml.nodes.Scalar
-
__doc__
= None¶
-
__module__
= 'pureyaml.nodes'¶
-
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'¶
-
type
¶ alias of
bool
-
-
class
pureyaml.nodes.
Binary
(value, *args, **kwargs)[source]¶ Bases:
pureyaml.nodes.Scalar
-
__doc__
= None¶
-
__module__
= 'pureyaml.nodes'¶
-
type
= 'binary'¶
-
-
class
pureyaml.nodes.
ScalarDispatch
[source]¶ Bases:
object
-
__dict__
= dict_proxy({'map': {'int16': <functools.partial object at 0x7f5b38b19aa0>, 'infinity': <class 'pureyaml.nodes.Float'>, 'int10': <functools.partial object at 0x7f5b38b199f0>, 'int': <class 'pureyaml.nodes.Int'>, 'float': <class 'pureyaml.nodes.Float'>, 'null': <class 'pureyaml.nodes.Null'>, 'int8': <functools.partial object at 0x7f5b38b19a48>, '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 0x7f5b38b08980>, 're_dispatch': <_sre.SRE_Pattern object at 0x10fcb40>, '__dict__': <attribute '__dict__' of 'ScalarDispatch' objects>, '__weakref__': <attribute '__weakref__' of 'ScalarDispatch' objects>, '__doc__': None})¶
-
__doc__
= None¶
-
__module__
= 'pureyaml.nodes'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
map
= {'int16': <functools.partial object at 0x7f5b38b19aa0>, 'infinity': <class 'pureyaml.nodes.Float'>, 'int10': <functools.partial object at 0x7f5b38b199f0>, 'int': <class 'pureyaml.nodes.Int'>, 'float': <class 'pureyaml.nodes.Float'>, 'null': <class 'pureyaml.nodes.Null'>, 'int8': <functools.partial object at 0x7f5b38b19a48>, '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 0x10fcb40>¶
-
-
class
pureyaml.nodes.
NodeVisitor
(*args, **kwargs)[source]¶ Bases:
object
-
__dict__
= dict_proxy({'__module__': 'pureyaml.nodes', '_visit': <function _visit at 0x7f5b38b1d578>, 'visit': <function visit at 0x7f5b38b1d500>, '__doc__': None, '__dict__': <attribute '__dict__' of 'NodeVisitor' objects>, '__weakref__': <attribute '__weakref__' of 'NodeVisitor' objects>, 'generic_visit': <function generic_visit at 0x7f5b38b1d5f0>, '__init__': <function __init__ at 0x7f5b38b1d488>})¶
-
__doc__
= None¶
-
__module__
= 'pureyaml.nodes'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
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.