Skip to main content

multidict implementation

Project description

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

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

This version

3.1.1

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

Uploaded Source

Built Distributions

multidict-3.1.1-cp36-cp36m-win_amd64.whl (155.5 kB view details)

Uploaded CPython 3.6m Windows x86-64

multidict-3.1.1-cp36-cp36m-win32.whl (144.3 kB view details)

Uploaded CPython 3.6m Windows x86

multidict-3.1.1-cp36-cp36m-manylinux1_x86_64.whl (398.1 kB view details)

Uploaded CPython 3.6m

multidict-3.1.1-cp36-cp36m-manylinux1_i686.whl (372.0 kB view details)

Uploaded CPython 3.6m

multidict-3.1.1-cp35-cp35m-win_amd64.whl (154.5 kB view details)

Uploaded CPython 3.5m Windows x86-64

multidict-3.1.1-cp35-cp35m-win32.whl (143.2 kB view details)

Uploaded CPython 3.5m Windows x86

multidict-3.1.1-cp35-cp35m-manylinux1_x86_64.whl (389.5 kB view details)

Uploaded CPython 3.5m

multidict-3.1.1-cp35-cp35m-manylinux1_i686.whl (363.3 kB view details)

Uploaded CPython 3.5m

multidict-3.1.1-cp34-cp34m-win_amd64.whl (151.4 kB view details)

Uploaded CPython 3.4m Windows x86-64

multidict-3.1.1-cp34-cp34m-win32.whl (143.7 kB view details)

Uploaded CPython 3.4m Windows x86

multidict-3.1.1-cp34-cp34m-manylinux1_x86_64.whl (385.2 kB view details)

Uploaded CPython 3.4m

multidict-3.1.1-cp34-cp34m-manylinux1_i686.whl (357.9 kB view details)

Uploaded CPython 3.4m

File details

Details for the file multidict-3.1.1.tar.gz.

File metadata

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

File hashes

Hashes for multidict-3.1.1.tar.gz
Algorithm Hash digest
SHA256 d77fde7a398a6b5ee5788e4da6b58a377019750af08bc31ab73ac53e539446c0
MD5 cc683f98d790785ca95a292f2bc0101d
BLAKE2b-256 0add09a50df832914dadca5e47c5c59e383118c2a47c2f0af3b26f5d33aeebe1

See more details on using hashes here.

Provenance

File details

Details for the file multidict-3.1.1-cp36-cp36m-win_amd64.whl.

File metadata

File hashes

Hashes for multidict-3.1.1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 93f31681ddab6c8bc555ba0994e1555c1086614b851d163a6fd22adc37a84ed7
MD5 7a284a3e09b9847426bbec6b3757847c
BLAKE2b-256 9cbbb06e09c42c62ea0b2304b763cf25c2fb63f84f42a94526dd7dbd3b653e2d

See more details on using hashes here.

Provenance

File details

Details for the file multidict-3.1.1-cp36-cp36m-win32.whl.

File metadata

File hashes

Hashes for multidict-3.1.1-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 d3484191086cc163c10efc8751c58bfd91e55f3f83c74571997153ffd0b16bb5
MD5 49f48664196d8780e1d6baa827a5397b
BLAKE2b-256 16d69186b847d33eaa584f9a634c995fd8a7407706be58805789e4ac508c44e7

See more details on using hashes here.

Provenance

File details

Details for the file multidict-3.1.1-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for multidict-3.1.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e0f084a8b42cbd78c49eacede55a60ca506c09fb8c2b7856233ead1cbfb89d89
MD5 323fa5483c815781b84c43f29b624639
BLAKE2b-256 d74596192f7a77e4cc22440aa2956e0e30772fb6dbcd347a985eb245ce7bddb5

See more details on using hashes here.

Provenance

File details

Details for the file multidict-3.1.1-cp36-cp36m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for multidict-3.1.1-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 6b03f347882e8cc8b4d9ca4145342db2d79ff145405c71edaad6cdacbf371006
MD5 c69dd322e3a16e42fa18172439fbe75a
BLAKE2b-256 2509dda2d7f7701304ee18c60356837001382f239571cf33b35184ff4fe0a54f

See more details on using hashes here.

Provenance

File details

Details for the file multidict-3.1.1-cp35-cp35m-win_amd64.whl.

File metadata

File hashes

Hashes for multidict-3.1.1-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 24a8a168985a242f0d737300e49a6b1a80351c16df21b5e0fd1b38bf337a4472
MD5 aa767bc943ed9485dbaa2745c2368ea2
BLAKE2b-256 f0ceed0d9056088dec49885806c8f48fd3eb2a5266b093dc9864b081cd75cd8c

See more details on using hashes here.

Provenance

File details

Details for the file multidict-3.1.1-cp35-cp35m-win32.whl.

File metadata

File hashes

Hashes for multidict-3.1.1-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 09a9ddee8ed6cc81f80a36c99301f69a8184e9a96070de50e1bba9193c6bd28c
MD5 c3d931e1bcfe2c572f6d11ed72497a93
BLAKE2b-256 c57be0f69eea2d3956eabd5d3c592e224bf0e2d25a3aa3dfd4b0a65e7c7b5891

See more details on using hashes here.

Provenance

File details

Details for the file multidict-3.1.1-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for multidict-3.1.1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 042d0b1db4ac6b18816aefa3b99ec57b92f62aa914ed9afa8bc53aed8692abcc
MD5 db27b3562ea317e24f7e6afed17a2328
BLAKE2b-256 cc734fd08c2ce45ffacd178d4c40520fbf1193c7d4608a9b4d6aea96567e4136

See more details on using hashes here.

Provenance

File details

Details for the file multidict-3.1.1-cp35-cp35m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for multidict-3.1.1-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 c245b29d31ef50038e07387bd0b6391607bae5ffd5e4969e6d87a5c79fbbbd2f
MD5 245efee212878cf48692f4e22e079ab8
BLAKE2b-256 1aab716881adb09b3604f4b7d103636ba380acc14aba1c9d265634b0a40a7e75

See more details on using hashes here.

Provenance

File details

Details for the file multidict-3.1.1-cp34-cp34m-win_amd64.whl.

File metadata

File hashes

Hashes for multidict-3.1.1-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 f0ff7a26ab72a81250059476b32c4699e562c0bf6d949d094275695243332c5b
MD5 0c1703500a7e23dff90e572c8489ede9
BLAKE2b-256 42ba2f08874c3824cfcec70ead1dfc1c4469ac9ca72bb0477541b1a6f827dbfb

See more details on using hashes here.

Provenance

File details

Details for the file multidict-3.1.1-cp34-cp34m-win32.whl.

File metadata

File hashes

Hashes for multidict-3.1.1-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 e8b5bd9c3ce25ab326d2fce4c55ae507bcb234f829e3c8cd016af2c9a215c60e
MD5 fdf725bf6895697df84388c30a5243d5
BLAKE2b-256 2c9ed0785cb54738c47a6c8605cbf0abb881371ea441fb4d1494aa2d67f4108e

See more details on using hashes here.

Provenance

File details

Details for the file multidict-3.1.1-cp34-cp34m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for multidict-3.1.1-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 98250340c82b2235827da12bb20cdcf572fc958a80953d6e1284244fd6b7930a
MD5 3cdf975be67c3f1ce234328b5f3ae813
BLAKE2b-256 81d555c7d161eb2e7e04a9b12082e0da05eb9d34b255ec4636a5d1d03e5eb3ab

See more details on using hashes here.

Provenance

File details

Details for the file multidict-3.1.1-cp34-cp34m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for multidict-3.1.1-cp34-cp34m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 9308cf7461a3ca34ce73b4a0f381ecaaa1b9089867e9d7fa2f7cad666d5ea3ac
MD5 f38dd4c72f83140c88e080d6bf29141a
BLAKE2b-256 7610fe04db5b2edbe19a1cf4f6d42ef21bd6816fc9db7f8e3c72b03d30367080

See more details on using hashes here.

Provenance

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