| 1 |
Metadata-Version: 2.1 |
| 2 |
Name: multidict |
| 3 |
Version: 6.1.0 |
| 4 |
Summary: multidict implementation |
| 5 |
Home-page: https://github.com/aio-libs/multidict |
| 6 |
Author: Andrew Svetlov |
| 7 |
Author-email: [email protected] |
| 8 |
License: Apache 2 |
| 9 |
Project-URL: Chat: Matrix, https://matrix.to/#/#aio-libs:matrix.org |
| 10 |
Project-URL: Chat: Matrix Space, https://matrix.to/#/#aio-libs-space:matrix.org |
| 11 |
Project-URL: CI: GitHub, https://github.com/aio-libs/multidict/actions |
| 12 |
Project-URL: Code of Conduct, https://github.com/aio-libs/.github/blob/master/CODE_OF_CONDUCT.md |
| 13 |
Project-URL: Coverage: codecov, https://codecov.io/github/aio-libs/multidict |
| 14 |
Project-URL: Docs: Changelog, https://multidict.aio-libs.org/en/latest/changes/ |
| 15 |
Project-URL: Docs: RTD, https://multidict.aio-libs.org |
| 16 |
Project-URL: GitHub: issues, https://github.com/aio-libs/multidict/issues |
| 17 |
Project-URL: GitHub: repo, https://github.com/aio-libs/multidict |
| 18 |
Classifier: Development Status :: 5 - Production/Stable |
| 19 |
Classifier: Intended Audience :: Developers |
| 20 |
Classifier: License :: OSI Approved :: Apache Software License |
| 21 |
Classifier: Programming Language :: Python |
| 22 |
Classifier: Programming Language :: Python :: 3 |
| 23 |
Classifier: Programming Language :: Python :: 3.8 |
| 24 |
Classifier: Programming Language :: Python :: 3.9 |
| 25 |
Classifier: Programming Language :: Python :: 3.10 |
| 26 |
Classifier: Programming Language :: Python :: 3.11 |
| 27 |
Classifier: Programming Language :: Python :: 3.12 |
| 28 |
Classifier: Programming Language :: Python :: 3.13 |
| 29 |
Requires-Python: >=3.8 |
| 30 |
Description-Content-Type: text/x-rst |
| 31 |
License-File: LICENSE |
| 32 |
Requires-Dist: typing-extensions >=4.1.0 ; python_version < "3.11" |
| 33 |
|
| 34 |
========= |
| 35 |
multidict |
| 36 |
========= |
| 37 |
|
| 38 |
.. image:: https://github.com/aio-libs/multidict/actions/workflows/ci-cd.yml/badge.svg |
| 39 |
:target: https://github.com/aio-libs/multidict/actions |
| 40 |
:alt: GitHub status for master branch |
| 41 |
|
| 42 |
.. image:: https://codecov.io/gh/aio-libs/multidict/branch/master/graph/badge.svg |
| 43 |
:target: https://codecov.io/gh/aio-libs/multidict |
| 44 |
:alt: Coverage metrics |
| 45 |
|
| 46 |
.. image:: https://img.shields.io/pypi/v/multidict.svg |
| 47 |
:target: https://pypi.org/project/multidict |
| 48 |
:alt: PyPI |
| 49 |
|
| 50 |
.. image:: https://readthedocs.org/projects/multidict/badge/?version=latest |
| 51 |
:target: https://multidict.aio-libs.org |
| 52 |
:alt: Read The Docs build status badge |
| 53 |
|
| 54 |
.. image:: https://img.shields.io/pypi/pyversions/multidict.svg |
| 55 |
:target: https://pypi.org/project/multidict |
| 56 |
:alt: Python versions |
| 57 |
|
| 58 |
.. image:: https://img.shields.io/matrix/aio-libs:matrix.org?label=Discuss%20on%20Matrix%20at%20%23aio-libs%3Amatrix.org&logo=matrix&server_fqdn=matrix.org&style=flat |
| 59 |
:target: https://matrix.to/#/%23aio-libs:matrix.org |
| 60 |
:alt: Matrix Room — #aio-libs:matrix.org |
| 61 |
|
| 62 |
.. image:: https://img.shields.io/matrix/aio-libs-space:matrix.org?label=Discuss%20on%20Matrix%20at%20%23aio-libs-space%3Amatrix.org&logo=matrix&server_fqdn=matrix.org&style=flat |
| 63 |
:target: https://matrix.to/#/%23aio-libs-space:matrix.org |
| 64 |
:alt: Matrix Space — #aio-libs-space:matrix.org |
| 65 |
|
| 66 |
Multidict is dict-like collection of *key-value pairs* where key |
| 67 |
might occur more than once in the container. |
| 68 |
|
| 69 |
Introduction |
| 70 |
------------ |
| 71 |
|
| 72 |
*HTTP Headers* and *URL query string* require specific data structure: |
| 73 |
*multidict*. It behaves mostly like a regular ``dict`` but it may have |
| 74 |
several *values* for the same *key* and *preserves insertion ordering*. |
| 75 |
|
| 76 |
The *key* is ``str`` (or ``istr`` for case-insensitive dictionaries). |
| 77 |
|
| 78 |
``multidict`` has four multidict classes: |
| 79 |
``MultiDict``, ``MultiDictProxy``, ``CIMultiDict`` |
| 80 |
and ``CIMultiDictProxy``. |
| 81 |
|
| 82 |
Immutable proxies (``MultiDictProxy`` and |
| 83 |
``CIMultiDictProxy``) provide a dynamic view for the |
| 84 |
proxied multidict, the view reflects underlying collection changes. They |
| 85 |
implement the ``collections.abc.Mapping`` interface. |
| 86 |
|
| 87 |
Regular mutable (``MultiDict`` and ``CIMultiDict``) classes |
| 88 |
implement ``collections.abc.MutableMapping`` and allows them to change |
| 89 |
their own content. |
| 90 |
|
| 91 |
|
| 92 |
*Case insensitive* (``CIMultiDict`` and |
| 93 |
``CIMultiDictProxy``) assume the *keys* are case |
| 94 |
insensitive, e.g.:: |
| 95 |
|
| 96 |
>>> dct = CIMultiDict(key='val') |
| 97 |
>>> 'Key' in dct |
| 98 |
True |
| 99 |
>>> dct['Key'] |
| 100 |
'val' |
| 101 |
|
| 102 |
*Keys* should be ``str`` or ``istr`` instances. |
| 103 |
|
| 104 |
The library has optional C Extensions for speed. |
| 105 |
|
| 106 |
|
| 107 |
License |
| 108 |
------- |
| 109 |
|
| 110 |
Apache 2 |
| 111 |
|
| 112 |
Library Installation |
| 113 |
-------------------- |
| 114 |
|
| 115 |
.. code-block:: bash |
| 116 |
|
| 117 |
$ pip install multidict |
| 118 |
|
| 119 |
The library is Python 3 only! |
| 120 |
|
| 121 |
PyPI contains binary wheels for Linux, Windows and MacOS. If you want to install |
| 122 |
``multidict`` on another operating system (or *Alpine Linux* inside a Docker) the |
| 123 |
tarball will be used to compile the library from source. It requires a C compiler and |
| 124 |
Python headers to be installed. |
| 125 |
|
| 126 |
To skip the compilation, please use the `MULTIDICT_NO_EXTENSIONS` environment variable, |
| 127 |
e.g.: |
| 128 |
|
| 129 |
.. code-block:: bash |
| 130 |
|
| 131 |
$ MULTIDICT_NO_EXTENSIONS=1 pip install multidict |
| 132 |
|
| 133 |
Please note, the pure Python (uncompiled) version is about 20-50 times slower depending on |
| 134 |
the usage scenario!!! |
| 135 |
|
| 136 |
|
| 137 |
|
| 138 |
Changelog |
| 139 |
--------- |
| 140 |
See `RTD page <http://multidict.aio-libs.org/en/latest/changes>`_. |