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

Uploaded Source

Built Distributions

multidict-3.1.0-cp36-cp36m-win_amd64.whl (155.4 kB view details)

Uploaded CPython 3.6m Windows x86-64

multidict-3.1.0-cp36-cp36m-win32.whl (144.2 kB view details)

Uploaded CPython 3.6m Windows x86

multidict-3.1.0-cp36-cp36m-manylinux1_x86_64.whl (398.0 kB view details)

Uploaded CPython 3.6m

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

Uploaded CPython 3.6m

multidict-3.1.0-cp35-cp35m-win_amd64.whl (154.4 kB view details)

Uploaded CPython 3.5m Windows x86-64

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

Uploaded CPython 3.5m Windows x86

multidict-3.1.0-cp35-cp35m-manylinux1_x86_64.whl (377.6 kB view details)

Uploaded CPython 3.5m

multidict-3.1.0-cp35-cp35m-manylinux1_i686.whl (363.2 kB view details)

Uploaded CPython 3.5m

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

Uploaded CPython 3.4m Windows x86-64

multidict-3.1.0-cp34-cp34m-win32.whl (143.6 kB view details)

Uploaded CPython 3.4m Windows x86

multidict-3.1.0-cp34-cp34m-manylinux1_x86_64.whl (397.1 kB view details)

Uploaded CPython 3.4m

multidict-3.1.0-cp34-cp34m-manylinux1_i686.whl (369.1 kB view details)

Uploaded CPython 3.4m

File details

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

File metadata

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

File hashes

Hashes for multidict-3.1.0.tar.gz
Algorithm Hash digest
SHA256 e2ca81ed62eca10152e8131900dc8e66b22a1a4bcd077b09d15e591bada6f593
MD5 388d612416d9d17d80a529dae259b29c
BLAKE2b-256 b7b6c23c11ad38f551fa3a38c6fe4c2aa6dfc10a1105831560f2a65ecafbefba

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for multidict-3.1.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 f7a7b54741e4f5b476ced383da8e2d951a2eb0e386c7058b7d7ab350bb932cf6
MD5 0d7ba7450840b91702caa47a6ba41bd1
BLAKE2b-256 228a84d8210f7d5b0999319f2807e6b429ddc90c21c259f876982068c480aedf

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for multidict-3.1.0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 304a587bc876b002f096690329ecef78f857a7224385619e1b16b272d25810a2
MD5 1f4b9e5f5d26ffc0b1a8143c0a718b50
BLAKE2b-256 4c2a9f339d2e9ee4ae22285506a59db1dc61feead0ed2bc41a0267064556084c

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for multidict-3.1.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c776e513abcb47d5a489daf6c6c7a10da6bf597eb2ad3c71dd2ef8bad47ce263
MD5 4d71a52a8dac4ab82150c91a42d8e15a
BLAKE2b-256 b69d27a2925203f99cb0517bad4fef109a2a788803258694f09b0be4517e6f47

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for multidict-3.1.0-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 c267ee22379c51e68f42b0ec984204cafd1d8b94c4d74620bf44353f37530682
MD5 295fa79ef776deb415c11833cacafba7
BLAKE2b-256 d5165a1e989fdf0ae608c780a32d04abee943ab8e5a501dfb76c2ac1b8dfd2db

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for multidict-3.1.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 15e6e4b55c04aeab5608710e1f82f9553ff82fdda10dcbcdcd837c9da920d059
MD5 4762fb1b6942eab58c53bfcdffb3b7f8
BLAKE2b-256 d767ad41c17a69c4e80dd85afcf568ef7059a2e2963c202a42da386ded83bcba

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for multidict-3.1.0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 7b1e606520885036f1435cc2714728221eab167da9ca5953b361a9260dec10db
MD5 f3c2ea8dc5b6bc26d5998520c68fae5a
BLAKE2b-256 423e565c4a86b09cf2d6ecabd1f11fd43ee2d4956e7bb1bcd6961d31aefce158

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for multidict-3.1.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 2fbeee053d3abc56240ca6f9536d866e3ec5ee37aebce5d2751458c6388ae77a
MD5 ede5a17be4aa827d91a26157b57f3ade
BLAKE2b-256 bd8363d432e270418a4b7ac3924ca09d7c5ba1da9b4972392a5833a3afa4ff90

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for multidict-3.1.0-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 d5bed94dc978668b36c19ce5f63dd99f543eb28da6b500b86ef844ae6da76641
MD5 38d90e4dc58818a4eceaeab5ff374060
BLAKE2b-256 fc3fb99585ce3e55b4d29b3efc6cae3bdf3eeb5ec2b5867651616762ebfa4ccf

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for multidict-3.1.0-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 c879513ca56e33907baba3189a83f3486a3f98853c056090ccaa7fd7431a068b
MD5 f8bb4c1278ffadeacb9b97a4f5023dee
BLAKE2b-256 9da724756b55b3bcb84faf800b7dbff45315514f81765a511a31e5bb9e19e724

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for multidict-3.1.0-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 53620fbe1fcd2d70ae6b89eec6e74d9b59782bbbd057b2c2fbd29362aaf6c6c0
MD5 a919811fe79aa9ab1b1356f3cd7d88aa
BLAKE2b-256 36b945d1bd49767f415c0dea93df60a4a2ca1f0f972c723d644fd50336c52064

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for multidict-3.1.0-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 b337749d935f2ebcce24af80f7af015cf1ae5cbf2eb1c1dec01696665a106727
MD5 16921b0f71d7087616a246fb7104105b
BLAKE2b-256 97f9efdba7168eaf210a5dd9a732f12f591d8a3c7ca398dc3da171e4ad87fda7

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for multidict-3.1.0-cp34-cp34m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 936d084945d9ae786f30e7997ca250d6cb9093680a1d96978b3d7374c7857a58
MD5 8cf6897a48f9090f4b2cd1a471c09630
BLAKE2b-256 5fed3b87fe4535020d09a91b023f782a0aac58a450f199fa575b6883a5404625

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