Skip to main content

multidict implementation

Project description

=========
multidict
=========

.. image:: https://travis-ci.org/aio-libs/multidict.svg?branch=master
:target: https://travis-ci.org/aio-libs/multidict
:align: right
.. image:: https://codecov.io/gh/aio-libs/multidict/branch/master/graph/badge.svg
:target: https://codecov.io/gh/aio-libs/multidict
.. image:: https://badges.gitter.im/Join%20Chat.svg
:target: https://gitter.im/aio-libs/Lobby
:alt: Chat on Gitter
Multidicts are useful for working with HTTP headers, URL
query args etc.

The code was extracted from aiohttp_ library.

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 Cython_ optimization for sake of speed.


License
-------

Apache 2


.. _aiohttp: https://github.com/KeepSafe/aiohttp
.. _Cython: http://cython.org/

3.1.3 (2017-07-14)
------------------

* Fix build

3.1.2 (2017-07-14)
------------------

* Fix type annotations


3.1.1 (2017-07-09)
------------------

* Fix #105: Remove memory leak in `istr` implementation

3.1.0 (2017-06-25)
------------------

* Fix #99: raise `RuntimeError` on dict iterations if the dict was changed

* Update `__init__.pyi` signatures

3.0.0 (2017-06-21)
------------------

* Refactor internal data structures: main dict operations are about
100% faster now.

* Preserve order on multidict updates #68

Updates are `md[key] = val` and `md.update(...)` calls.

Now **the last** entry is replaced with new key/value pair, all
previous occurrences are removed.

If key is not present in dictionary the pair is added to the end

* Force keys to `str` instances #88

* Implement `.popall(key[, default])` #84

* `.pop()` removes only first occurence, `.popone()` added #92

* Implement dict's version #86

* Proxies are not pickable anymore #77

2.1.7 (2017-05-29)
------------------

* Fix import warning on Python 3.6 #79

2.1.6 (2017-05-27)
------------------

* Rebuild the library for fixning missing `__spec__` attribute #79

2.1.5 (2017-05-13)
------------------

* Build Python 3.6 binary wheels

2.1.4 (2016-12-1)
------------------

* Remove LICENSE filename extension @ MANIFEST.in file #31

2.1.3 (2016-11-26)
------------------

* Add a fastpath for multidict extending by multidict


2.1.2 (2016-09-25)
------------------

* Fix `CIMultiDict.update()` for case of accepting `istr`


2.1.1 (2016-09-22)
------------------

* Fix `CIMultiDict` constructor for case of accepting `istr` #11


2.1.0 (2016-09-18)
------------------

* Allow to create proxy from proxy

* Add type hints (PEP-484)


2.0.1 (2016-08-02)
------------------

* Don't crash on `{} - MultiDict().keys()` and similar operations #6


2.0.0 (2016-07-28)
------------------

* Switch from uppercase approach for case-insensitive string to
`str.title()` #5

* Deprecase `upstr` class in favor of `istr` alias.

1.2.2 (2016-08-02)
------------------

* Don't crash on `{} - MultiDict().keys()` and similar operations #6

1.2.1 (2016-07-21)
------------------

* Don't expose `multidict.__version__`


1.2.0 (2016-07-16)
------------------

* Make `upstr(upstr('abc'))` much faster


1.1.0 (2016-07-06)
------------------

* Don't double-iterate during MultiDict initialization #3

* Fix CIMultiDict.pop: it is case insensitive now #1

* Provide manylinux wheels as well as Windows ones

1.0.3 (2016-03-24)
------------------

* Add missing MANIFEST.in

1.0.2 (2016-03-24)
------------------

* Fix setup build


1.0.0 (2016-02-19)
------------------

* Initial implementation

Project details


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-3.1.3a0.tar.gz (118.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

multidict-3.1.3a0-cp36-cp36m-win_amd64.whl (155.7 kB view details)

Uploaded CPython 3.6mWindows x86-64

multidict-3.1.3a0-cp36-cp36m-win32.whl (144.5 kB view details)

Uploaded CPython 3.6mWindows x86

multidict-3.1.3a0-cp36-cp36m-manylinux1_x86_64.whl (398.5 kB view details)

Uploaded CPython 3.6m

multidict-3.1.3a0-cp36-cp36m-manylinux1_i686.whl (372.4 kB view details)

Uploaded CPython 3.6m

multidict-3.1.3a0-cp35-cp35m-win_amd64.whl (154.7 kB view details)

Uploaded CPython 3.5mWindows x86-64

multidict-3.1.3a0-cp35-cp35m-win32.whl (143.4 kB view details)

Uploaded CPython 3.5mWindows x86

multidict-3.1.3a0-cp35-cp35m-manylinux1_x86_64.whl (377.9 kB view details)

Uploaded CPython 3.5m

multidict-3.1.3a0-cp35-cp35m-manylinux1_i686.whl (363.6 kB view details)

Uploaded CPython 3.5m

multidict-3.1.3a0-cp34-cp34m-manylinux1_x86_64.whl (397.5 kB view details)

Uploaded CPython 3.4m

multidict-3.1.3a0-cp34-cp34m-manylinux1_i686.whl (369.5 kB view details)

Uploaded CPython 3.4m

File details

Details for the file multidict-3.1.3a0.tar.gz.

File metadata

  • Download URL: multidict-3.1.3a0.tar.gz
  • Upload date:
  • Size: 118.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for multidict-3.1.3a0.tar.gz
Algorithm Hash digest
SHA256 e4c5439834e9d26524a85485c3ad6deb1de6c7328d0aaf045cea62e323013278
MD5 8f40bd7efb3fc3e92470501c997cd490
BLAKE2b-256 74a15e81f607d9d36b681f0a605aba2feeb1182c643793617bad10ac4d9dc566

See more details on using hashes here.

File details

Details for the file multidict-3.1.3a0-cp36-cp36m-win_amd64.whl.

File metadata

File hashes

Hashes for multidict-3.1.3a0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 129882459d72676f3abaae22e910f16dbee6d244a374931a7a9bdced665534b5
MD5 848c80d41e0dda0b3a89127c5346d333
BLAKE2b-256 c36055221563b64f58d21cbda0de5ce461d93098a41d200e288a8cf575568488

See more details on using hashes here.

File details

Details for the file multidict-3.1.3a0-cp36-cp36m-win32.whl.

File metadata

File hashes

Hashes for multidict-3.1.3a0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 13cc6e43f68ce09a23163d70a6b5f609f9ec1d228d67d7786ff02d883202ba5b
MD5 12a87a27ecc28a22b2dcd8dc7ab86002
BLAKE2b-256 4bdb96a9791b4d455021de436beea680b272791f825494a008113f3b631b78b4

See more details on using hashes here.

File details

Details for the file multidict-3.1.3a0-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for multidict-3.1.3a0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 81426239b54a365e470f00923114c7e645bdbbdd66ccf8445cbefbbad7693053
MD5 e7a87f2307027d4e51971e73720b9723
BLAKE2b-256 930462cd96e4c019e8406f497d3e9f610f52b696e76276272743bfedc2436701

See more details on using hashes here.

File details

Details for the file multidict-3.1.3a0-cp36-cp36m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for multidict-3.1.3a0-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 6bc8614c380f00cf722c8d325673d4e7d7e17514a22953cf915eef0a65649632
MD5 0e57f9615f7c88f4becafa9ed18c77b7
BLAKE2b-256 f8749ab3196b8dbc49f8cee9dbedcc5b199cfd66a923e0622b39f6e63f098954

See more details on using hashes here.

File details

Details for the file multidict-3.1.3a0-cp35-cp35m-win_amd64.whl.

File metadata

File hashes

Hashes for multidict-3.1.3a0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 82b53e075fac852a472bdb5ee915ce15d17297dbfec504c8a34e90060ba12128
MD5 ab7e51d41ee818381fd5001ef4bcec89
BLAKE2b-256 eb27828535dd1e85841cf2e4ecfb33f1f049fdc664871dc3af9c65587ee31dff

See more details on using hashes here.

File details

Details for the file multidict-3.1.3a0-cp35-cp35m-win32.whl.

File metadata

File hashes

Hashes for multidict-3.1.3a0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 98e6921210fc874df13a1a692518f1d4d347f7d90d9560b76672a5d9bdbf8184
MD5 ab975391f19ad8a9a3f9fe0e47e26c72
BLAKE2b-256 c79205a387b30359e955da6d3a06649fdfe2553d362e41a3b36b7003d9c5bf06

See more details on using hashes here.

File details

Details for the file multidict-3.1.3a0-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for multidict-3.1.3a0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a4dcf72592b4609a900cb3af11afee2c7dfda2a397dd65e09880ace859f4642e
MD5 0b9703422b8d1e438a168cfd34ae23d8
BLAKE2b-256 e92b462adb5975a59497b0998030a4f795dfe1f82830954213d3527fef1c4f0e

See more details on using hashes here.

File details

Details for the file multidict-3.1.3a0-cp35-cp35m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for multidict-3.1.3a0-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 dc0b326059542eeb0c4f20d250b8824ce361eca9fb3448fe4e196c1b8910c8ea
MD5 ab0537ae5c6ab06b2c3280640a0888d4
BLAKE2b-256 fd6cf6541f6da60b8d01ae451f2acc24474e9e3465bfe5a1c060e9d1edf422f6

See more details on using hashes here.

File details

Details for the file multidict-3.1.3a0-cp34-cp34m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for multidict-3.1.3a0-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1ab03b63ca2c28c583df436f60efbbae74810b7c8e5e4fc71dbfe479d96d4d9b
MD5 72f8144bd00cc03383c4f40bc17b8598
BLAKE2b-256 ee7fefff0b5154a7b920365ea9d5a221e22b8d8069c88d207f3f4ef919d5b88f

See more details on using hashes here.

File details

Details for the file multidict-3.1.3a0-cp34-cp34m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for multidict-3.1.3a0-cp34-cp34m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 53d6c3b4d3d003f25699fdb973a97b4faafbe759f879ddb39febee627a578b81
MD5 cf9b51749e383c098b84f58c12391205
BLAKE2b-256 f339fd3d393b819843ca49f727e0161fbeb550a06b17b3977300caa106a783b6

See more details on using hashes here.

Supported by

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