Source code

Revision control

Copy as Markdown

Other Tools

Metadata-Version: 1.2
Name: multidict
Version: 5.1.0
Summary: multidict implementation
Author: Andrew Svetlov
Author-email: andrew.svetlov@gmail.com
License: Apache 2
Project-URL: Chat: Gitter, https://gitter.im/aio-libs/Lobby
Project-URL: CI: Azure Pipelines, https://dev.azure.com/aio-libs/multidict/_build
Project-URL: Coverage: codecov, https://codecov.io/github/aio-libs/multidict
Project-URL: Docs: RTD, https://multidict.readthedocs.io
Project-URL: GitHub: issues, https://github.com/aio-libs/multidict/issues
Project-URL: GitHub: repo, https://github.com/aio-libs/multidict
Description: =========
multidict
=========
:alt: GitHub status for master branch
:alt: Coverage metrics
:alt: PyPI
:alt: Documentationb
:alt: Python versions
:alt: Chat on Gitter
Multidict is dict-like collection of *key-value pairs* where key
might be occurred more than once in the container.
Introduction
------------
*HTTP Headers* and *URL query string* require specific data structure:
*multidict*. It behaves mostly like a regular ``dict`` but it may have
several *values* for the same *key* and *preserves insertion ordering*.
The *key* is ``str`` (or ``istr`` for case-insensitive dictionaries).
``multidict`` has four multidict classes:
``MultiDict``, ``MultiDictProxy``, ``CIMultiDict``
and ``CIMultiDictProxy``.
Immutable proxies (``MultiDictProxy`` and
``CIMultiDictProxy``) provide a dynamic view for the
proxied multidict, the view reflects underlying collection changes. They
implement the ``collections.abc.Mapping`` interface.
Regular mutable (``MultiDict`` and ``CIMultiDict``) classes
implement ``collections.abc.MutableMapping`` and allows to change
their own content.
*Case insensitive* (``CIMultiDict`` and
``CIMultiDictProxy``) ones assume the *keys* are case
insensitive, e.g.::
>>> dct = CIMultiDict(key='val')
>>> 'Key' in dct
True
>>> dct['Key']
'val'
*Keys* should be ``str`` or ``istr`` instances.
The library has optional C Extensions for sake of speed.
License
-------
Apache 2
Library Installation
--------------------
.. code-block:: bash
$ pip install multidict
The library is Python 3 only!
PyPI contains binary wheels for Linux, Windows and MacOS. If you want to install
``multidict`` on another operation system (or *Alpine Linux* inside a Docker) the
Tarball will be used to compile the library from sources. It requires C compiler and
Python headers installed.
To skip the compilation please use `MULTIDICT_NO_EXTENSIONS` environment variable,
e.g.:
.. code-block:: bash
$ MULTIDICT_NO_EXTENSIONS=1 pip install multidict
Please note, Pure Python (uncompiled) version is about 20-50 times slower depending on
the usage scenario!!!
Changelog
---------
Platform: UNKNOWN
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Development Status :: 5 - Production/Stable
Requires-Python: >=3.6