Skip to main content

multidict implementation

Project description

GitHub status for master branch Coverage metrics PyPI Documentationb Python versions Chat on Gitter

Multidict is dict-like collection of key-value pairs where key might be occurred more than once in the container.


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 interface.

Regular mutable (MultiDict and CIMultiDict) classes implement 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
>>> dct['Key']

Keys should be str or istr instances.

The library has optional C Extensions for sake of speed.


Apache 2

Library Installation

$ 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.:

$ MULTIDICT_NO_EXTENSIONS=1 pip install multidict

Please note, Pure Python (uncompiled) version is about 20-50 times slower depending on the usage scenario!!!


See RTD page.

Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

multidict-6.0.2.tar.gz (50.3 kB view hashes)

Uploaded source

Built Distributions

multidict-6.0.2-cp310-cp310-win_amd64.whl (28.0 kB view hashes)

Uploaded cp310

multidict-6.0.2-cp310-cp310-win32.whl (25.6 kB view hashes)

Uploaded cp310

multidict-6.0.2-cp39-cp39-win_amd64.whl (28.0 kB view hashes)

Uploaded cp39

multidict-6.0.2-cp39-cp39-win32.whl (25.6 kB view hashes)

Uploaded cp39

multidict-6.0.2-cp38-cp38-win_amd64.whl (28.0 kB view hashes)

Uploaded cp38

multidict-6.0.2-cp38-cp38-win32.whl (25.6 kB view hashes)

Uploaded cp38

multidict-6.0.2-cp37-cp37m-win_amd64.whl (27.5 kB view hashes)

Uploaded cp37

multidict-6.0.2-cp37-cp37m-win32.whl (25.3 kB view hashes)

Uploaded cp37

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page