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.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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

Uploaded CPython 3.6m Windows x86-64

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

Uploaded CPython 3.6m Windows x86

multidict-3.1.2-cp35-cp35m-win_amd64.whl (154.6 kB view details)

Uploaded CPython 3.5m Windows x86-64

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

Uploaded CPython 3.5m Windows x86

File details

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

File metadata

File hashes

Hashes for multidict-3.1.2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 c7dc1cc4efbdd3def4031b5563af2c924eae3daf4bfa55abf9e4470d5fa0b341
MD5 84b337770ee714ed57ccff0a3b6be94d
BLAKE2b-256 201076a9e138ab99acac30d8ac6e97c1118c352f62a5fe15ef9aad7b41d21c8b

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for multidict-3.1.2-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 9ffca666f60aca49f07f36843959b7023b0aee33acf35577a56467517bb764a0
MD5 d1b5b027b538456fce8701adb26c6a77
BLAKE2b-256 85ede5567d9d24dfc2fe0dbd1b33496ad61a85e992023cc39ae7aa620e1a05d7

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for multidict-3.1.2-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 c394085c839ac723717c5014ed23a3abc2c839127e106b07dc56d5cdfe967d66
MD5 013dbeed20e9ebcf4a2a0cbb021618e6
BLAKE2b-256 559c1ab593957110998c290503df5c0be15c7a89692eade09e955abba79cee9f

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for multidict-3.1.2-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 12b370897dceb0749e208c2457656df505e5e44f15226b6b525bbf10a992d8c2
MD5 c77f8b096480055fa008db2aef3d7c83
BLAKE2b-256 191dab184ccae45e54b7450c0800e2e2e5011a89314c5b115d9cc91bcc57e9d1

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