Skip to main content

multidict implementation

Project description

Azure Pipelines 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.

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

$ 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!!!

Changelog

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.

Files for multidict, version 5.0.0
Filename, size File type Python version Upload date Hashes
Filename, size multidict-5.0.0-cp36-cp36m-macosx_10_14_x86_64.whl (48.8 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size multidict-5.0.0-cp36-cp36m-manylinux1_i686.whl (137.0 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size multidict-5.0.0-cp36-cp36m-manylinux2014_aarch64.whl (145.3 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size multidict-5.0.0-cp36-cp36m-manylinux2014_i686.whl (137.0 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size multidict-5.0.0-cp36-cp36m-manylinux2014_ppc64le.whl (149.1 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size multidict-5.0.0-cp36-cp36m-manylinux2014_s390x.whl (141.3 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size multidict-5.0.0-cp36-cp36m-manylinux2014_x86_64.whl (141.4 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size multidict-5.0.0-cp36-cp36m-win_amd64.whl (48.6 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size multidict-5.0.0-cp37-cp37m-macosx_10_14_x86_64.whl (48.8 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size multidict-5.0.0-cp37-cp37m-manylinux1_i686.whl (138.0 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size multidict-5.0.0-cp37-cp37m-manylinux2014_aarch64.whl (146.3 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size multidict-5.0.0-cp37-cp37m-manylinux2014_i686.whl (138.0 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size multidict-5.0.0-cp37-cp37m-manylinux2014_ppc64le.whl (150.0 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size multidict-5.0.0-cp37-cp37m-manylinux2014_s390x.whl (142.3 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size multidict-5.0.0-cp37-cp37m-manylinux2014_x86_64.whl (142.4 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size multidict-5.0.0-cp37-cp37m-win_amd64.whl (48.6 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size multidict-5.0.0-cp38-cp38-macosx_10_14_x86_64.whl (48.9 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size multidict-5.0.0-cp38-cp38-manylinux1_i686.whl (155.5 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size multidict-5.0.0-cp38-cp38-manylinux2014_aarch64.whl (163.0 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size multidict-5.0.0-cp38-cp38-manylinux2014_i686.whl (155.5 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size multidict-5.0.0-cp38-cp38-manylinux2014_ppc64le.whl (168.1 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size multidict-5.0.0-cp38-cp38-manylinux2014_s390x.whl (163.1 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size multidict-5.0.0-cp38-cp38-manylinux2014_x86_64.whl (159.2 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size multidict-5.0.0-cp38-cp38-win_amd64.whl (48.9 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size multidict-5.0.0-cp39-cp39-macosx_10_14_x86_64.whl (48.9 kB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size multidict-5.0.0-cp39-cp39-manylinux1_i686.whl (147.7 kB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size multidict-5.0.0-cp39-cp39-manylinux2014_aarch64.whl (154.6 kB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size multidict-5.0.0-cp39-cp39-manylinux2014_i686.whl (147.7 kB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size multidict-5.0.0-cp39-cp39-manylinux2014_ppc64le.whl (159.1 kB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size multidict-5.0.0-cp39-cp39-manylinux2014_s390x.whl (154.7 kB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size multidict-5.0.0-cp39-cp39-manylinux2014_x86_64.whl (151.1 kB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size multidict-5.0.0-cp39-cp39-win_amd64.whl (48.8 kB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size multidict-5.0.0.tar.gz (53.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page