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 dict but it can have several values for the same key.

multidict has four multidict classes: MultiDict, MultiDictProxy, CIMultiDict and CIMultiDictProxy.

Immutable proxies (MultiDictProxy and CIMultiDictProxy) provide a dynamic view on 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 assumes the keys are case insensitive, e.g.:

>>> dct = CIMultiDict(a='val')
>>> 'A' in dct
True
>>> dct['A']
'val'

Keys should be str instances.

The library has optional Cython optimization for sake of speed.

License

Apache 2

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-1.1.0a1-cp35-cp35m-win_amd64.whl (127.1 kB view hashes)

Uploaded CPython 3.5m Windows x86-64

multidict-1.1.0a1-cp35-cp35m-win32.whl (119.8 kB view hashes)

Uploaded CPython 3.5m Windows x86

multidict-1.1.0a1-cp34-cp34m-win_amd64.whl (131.5 kB view hashes)

Uploaded CPython 3.4m Windows x86-64

multidict-1.1.0a1-cp34-cp34m-win32.whl (120.9 kB view hashes)

Uploaded CPython 3.4m Windows x86

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