Skip to main content

A sub-class of dict that allows nested key access e.g. a['a.b.c']

Project description

nesteddict

VERSION=0.1.1.alpha

class collections.NestedDict(self, seq=None, **kwargs)

Return an instance of a dict subclass, supporting the usual dict methods. An NestedDict is a dict that that only supports keys of type str. Those keys may be nested by separating them with dots '.'. Hence a valid uses of NestedDict are:

>>> from nesteddict import NestedDict
>>> a=NestedDict()
>>> a['x.y.z']=1
>>> a
{'x': {'y': {'z': 1}}}
>>> a['x.y']
{'z': 1}

Non str keys will throw a KeyError exception.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nesteddict-0.1.2a0.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

nesteddict-0.1.2a0-py2.py3-none-any.whl (6.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file nesteddict-0.1.2a0.tar.gz.

File metadata

  • Download URL: nesteddict-0.1.2a0.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.4

File hashes

Hashes for nesteddict-0.1.2a0.tar.gz
Algorithm Hash digest
SHA256 0117b3de945dfb1cfc9482eb3f78a3fcac326d76842545d67270c4e620082c02
MD5 555748eb830b400661ff2f725c15a116
BLAKE2b-256 dcdc77fb94c33e8b5ec5346134e1287b3eb9a5f5263078c2dcf787e61a1eeb85

See more details on using hashes here.

File details

Details for the file nesteddict-0.1.2a0-py2.py3-none-any.whl.

File metadata

  • Download URL: nesteddict-0.1.2a0-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.4

File hashes

Hashes for nesteddict-0.1.2a0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ce621afda17b51efa662d14ff59be3c2cb36c6a635d9fc9022bbfbf19a044fc6
MD5 907b83e890b53dfc188899ecc0c48025
BLAKE2b-256 9afa5a1acf906f7a85477475354205fcfca2e1d2dc31d20ce465f2fb9a743939

See more details on using hashes here.

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