Metadata-Version: 2.0
Name: chainmap
Version: 1.0.0
Summary: Backport/clone of ChainMap for py26, py32, and pypy3.
Home-page: https://bitbucket.org/jeunice/chainmap
Author: Jonathan Eunice
Author-email: jonathan.eunice@gmail.com
License: Python Software Foundation License
Keywords: ChainMap nested context layer overlay stack
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Operating System :: OS Independent
Classifier: License :: OSI Approved :: Python Software Foundation License
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.2
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Libraries :: Python Modules

| |version| |downloads| |versions| |impls| |wheel| |coverage| 

.. |version| image:: http://img.shields.io/pypi/v/chainmap.svg?style=flat
    :alt: PyPI Package latest release
    :target: https://pypi.python.org/pypi/chainmap

.. |downloads| image:: http://img.shields.io/pypi/dm/chainmap.svg?style=flat
    :alt: PyPI Package monthly downloads
    :target: https://pypi.python.org/pypi/chainmap

.. |versions| image:: https://img.shields.io/pypi/pyversions/chainmap.svg
    :alt: Supported versions
    :target: https://pypi.python.org/pypi/chainmap

.. |impls| image:: https://img.shields.io/pypi/implementation/chainmap.svg
    :alt: Supported implementations
    :target: https://pypi.python.org/pypi/chainmap

.. |wheel| image:: https://img.shields.io/pypi/wheel/chainmap.svg
    :alt: Wheel packaging support
    :target: https://pypi.python.org/pypi/chainmap

.. |coverage| image:: https://img.shields.io/badge/test_coverage-100%25-6600CC.svg
    :alt: Test line coverage
    :target: https://pypi.python.org/pypi/chainmap


This module is a `polyfill <https://en.wikipedia.org/wiki/Polyfill>`_,
implementing
``ChainMap`` for reasonably-recent versions of Python
that do not have ``collections.ChainMap``--namely, Python 2.6, Python 3.2,
and PyPy3 releases based on Python 3.2.

It is closely derived from Python 3.5 source code at `hg.python.org
<https://hg.python.org>`_, (especially the ``collections`` and ``reprlib``
modules). Several changes have been made to ensure Python 2.6 compatibility,
and tests and packaging have been added.

Typical usage::

    try:
        from collections import ChainMap
    except ImportError:
        from chainmap import ChainMap

This preferentially imports from the Python standard library if
available, using the ``chainmap`` only when it isn't otherwise available.

Optionally, you may import it all of the time::

    from chainmap import ChainMap

Please see `the standard documentation <https://docs.python.org/3/library/collections.html#collections.ChainMap>`_
for details on how to use ``ChainMap``.

If you're not sure *why* someone would use a ``ChainMap``, they are useful
for managing "nested" contexts and "overlays." See e.g. my `options
<https://pypi.python.org/pypi/options>`_ and `say
<https://pypi.python.org/pypi/say>`_, which use them quite extensively for
flexible option handling. You can find similar uses in the `Context class
<https://docs.djangoproject.com/en/1.8/ref/templates/api/#django.template.Context>`_
of Django's template engine.

Installation
============

To install or upgrade to the latest version::

    pip install -U chainmap

To ``easy_install`` under a specific Python version (3.3 in this example)::

    python3.3 -m easy_install --upgrade chainmap

(You may need to prefix these with ``sudo`` to authorize
installation. In environments without super-user privileges, you may want to
use ``pip``'s ``--user`` option, to install only for a single user, rather
than system-wide.)


