Skip to main content

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

Project description

nesteddict

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

Uploaded Source

Built Distribution

nesteddict-0.1a2-py2.py3-none-any.whl (5.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file nesteddict-0.1a2.tar.gz.

File metadata

  • Download URL: nesteddict-0.1a2.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.5

File hashes

Hashes for nesteddict-0.1a2.tar.gz
Algorithm Hash digest
SHA256 59fb763cbce779b4a7a191386e6b03a865513518f5187ca22cd2a98363ffa3b3
MD5 ed50e62d0d632e9e4b1e212f5bf46897
BLAKE2b-256 3200e68237b301fe56df0cd72f63bd2887fbb6927454b3c8726e35d796b3aea6

See more details on using hashes here.

File details

Details for the file nesteddict-0.1a2-py2.py3-none-any.whl.

File metadata

  • Download URL: nesteddict-0.1a2-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.5

File hashes

Hashes for nesteddict-0.1a2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f4ccdf4f3a48585ed7df2d6114c31a9236387aeb04841cf100ce7bafbfac67c6
MD5 d7d95d0fbccc824ca015fafe343769c4
BLAKE2b-256 38adee5c2c679271c08822c27e2af29587d52aeb4b9ba672bf7c216e11cb2b92

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