multidict

multidict implementation

Apache License 2.0 150 个版本 Python >=3.9
安装
pip install multidict
poetry add multidict
pipenv install multidict
conda install multidict
描述

========= multidict

.. image:: https://github.com/aio-libs/multidict/actions/workflows/ci-cd.yml/badge.svg :target: https://github.com/aio-libs/multidict/actions :alt: GitHub status for master branch

.. image:: https://codecov.io/gh/aio-libs/multidict/branch/master/graph/badge.svg?flag=pytest :target: https://codecov.io/gh/aio-libs/multidict?flags[]=pytest :alt: Coverage metrics

.. image:: https://img.shields.io/pypi/v/multidict.svg :target: https://pypi.org/project/multidict :alt: PyPI

.. image:: https://readthedocs.org/projects/multidict/badge/?version=latest :target: https://multidict.aio-libs.org :alt: Read The Docs build status badge

.. image:: https://img.shields.io/endpoint?url=https://codspeed.io/badge.json :target: https://codspeed.io/aio-libs/multidict :alt: CodSpeed

.. image:: https://img.shields.io/pypi/pyversions/multidict.svg :target: https://pypi.org/project/multidict :alt: Python versions

.. 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 :target: https://matrix.to/#/%23aio-libs:matrix.org :alt: Matrix Room — #aio-libs:matrix.org

.. 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 :target: https://matrix.to/#/%23aio-libs-space:matrix.org :alt: Matrix Space — #aio-libs-space:matrix.org

Multidict is dict-like collection of key-value pairs where key might occur 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 them to change their own content.

Case insensitive (CIMultiDict and CIMultiDictProxy) 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 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 operating system (or Alpine Linux inside a Docker) the tarball will be used to compile the library from source. It requires a C compiler and Python headers to be installed.

To skip the compilation, please use the MULTIDICT_NO_EXTENSIONS environment variable, e.g.:

.. code-block:: bash

$ MULTIDICT_NO_EXTENSIONS=1 pip install multidict

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

For extension development, set the MULTIDICT_DEBUG_BUILD environment variable to compile the extensions in debug mode:

.. code-block:: console

$ MULTIDICT_DEBUG_BUILD=1 pip install multidict

Changelog

See RTD page <http://multidict.aio-libs.org/en/latest/changes>_.

版本列表
6.7.1 2026-01-26
6.7.0 2025-10-06
6.6.4 2025-08-11
6.6.3 2025-06-30
6.6.2 2025-06-28
6.6.1 2025-06-28
6.6.0 2025-06-27
6.5.1 2025-06-24
6.5.0 2025-06-17
6.4.4 2025-05-19
6.4.3 2025-04-10
6.4.2 2025-04-09
6.4.1 2025-04-09
6.4.0 2025-04-09
6.3.2 2025-04-03
6.3.1 2025-04-01
6.3.0 2025-03-31
6.2.0 2025-03-17
6.1.0 2024-09-09
6.0.5 2024-02-01
6.0.4 2022-12-24
6.0.3 2022-12-03
6.0.2 2022-01-24
6.0.1 2022-01-23
6.0.0 2022-01-22
5.2.0 2021-10-03
5.2.0a6 2021-09-30
5.2.0a25 2021-10-03
5.2.0a24 2021-10-03
5.2.0a15 2021-10-02
5.2.0a12 2021-10-02
5.2.0a0 2021-09-30
5.1.0 2020-12-03
5.0.2 2020-11-14
5.0.1 2020-11-14
5.0.0 2020-10-12
4.7.6 2020-05-14
4.7.5 2020-02-21
4.7.4 2020-01-11
4.7.3 2019-12-30
4.7.2 2019-12-20
4.7.1 2019-12-11
4.7.0 2019-12-10
4.6.1 2019-11-21
4.6.0 2019-11-20
4.6.0a3 2019-11-20
4.6.0a2 2019-11-19
4.5.2 2018-11-28
4.5.1 2018-11-22
4.5.0 2018-11-19
4.4.2 2018-09-18
4.4.1 2018-09-17
4.4.0 2018-09-03
4.4.0a9 2018-08-11
4.4.0a8 2018-08-11
4.4.0a7 2018-08-10
4.4.0a6 2018-08-10
4.4.0a5 2018-08-09
4.4.0a42 2018-09-03
4.4.0a40 2018-09-03
4.4.0a4 2018-08-06
4.4.0a39 2018-08-25
4.4.0a38 2018-08-13
4.4.0a37 2018-08-13
4.4.0a36 2018-08-13
4.4.0a35 2018-08-13
4.4.0a34 2018-08-13
4.4.0a33 2018-08-13
4.4.0a32 2018-08-13
4.4.0a31 2018-08-13
4.4.0a30 2018-08-13
4.4.0a3 2018-08-02
4.4.0a29 2018-08-12
4.4.0a28 2018-08-12
4.4.0a27 2018-08-12
4.4.0a26 2018-08-12
4.4.0a25 2018-08-12
4.4.0a24 2018-08-12
4.4.0a23 2018-08-12
4.4.0a22 2018-08-12
4.4.0a21 2018-08-12
4.4.0a20 2018-08-12
4.4.0a2 2018-08-02
4.4.0a19 2018-08-12
4.4.0a18 2018-08-12
4.4.0a17 2018-08-12
4.4.0a16 2018-08-12
4.4.0a15 2018-08-11
4.4.0a14 2018-08-11
4.4.0a13 2018-08-11
4.4.0a12 2018-08-11
4.4.0a11 2018-08-11
4.4.0a10 2018-08-11
4.4.0a1 2018-08-01
4.4.0a0 2018-08-01
4.3.1 2018-05-06
4.3.0 2018-05-06
4.2.0 2018-04-15
4.1.0 2018-01-28
4.0.0 2018-01-16
3.3.2 2017-11-02
3.3.1 2017-11-02
3.3.0 2017-10-15
3.2.0 2017-09-17
3.2.1a0 2017-10-14
3.2.0a3 2017-09-16
3.1.3 2017-07-14
3.1.2 2017-07-14
3.1.1 2017-07-08
3.1.0 2017-06-25
3.1.4a3 2017-07-25
3.1.4a2 2017-07-25
3.1.4a1 2017-07-25
3.1.4a0 2017-07-16
3.1.3a0 2017-07-14
3.0.0 2017-06-21
2.1.6 2017-05-28
2.1.5 2017-05-13
2.1.4 2016-12-01
2.1.3 2016-11-26
2.1.2 2016-09-25
2.1.1 2016-09-22
2.1.0 2016-09-18
2.0.1 2016-08-02
2.0.0 2016-07-28
1.3.0a1 2016-07-21
1.3.0a0 2016-07-21
1.2.2 2016-08-02
1.2.1 2016-07-21
1.2.0 2016-07-16
1.1.0 2016-07-06
1.1.0b8 2016-07-06
1.1.0b7 2016-07-06
1.1.0b6 2016-07-06
1.1.0b5 2016-07-06
1.1.0b4 2016-06-05
1.1.0b3 2016-06-05
1.1.0b2 2016-06-04
1.1.0b1 2016-06-04
1.1.0a6 2016-04-24
1.1.0a5 2016-04-16
1.1.0a3 2016-04-16
1.1.0a2 2016-04-16
1.1.0a1 2016-04-16
1.1.0a0 2016-04-16
1.0.3 2016-03-24
1.0.2 2016-03-24
1.0.1 2016-02-19
1.0.0a0 2016-02-19