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

Uploaded Source

Built Distribution

nesteddict-0.1.3-py2.py3-none-any.whl (9.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file nesteddict-0.1.3.tar.gz.

File metadata

  • Download URL: nesteddict-0.1.3.tar.gz
  • Upload date:
  • Size: 5.5 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.3.tar.gz
Algorithm Hash digest
SHA256 07e5f59684df992559e6f25210edec8f5bc1cfc7114d9332d690f30fc1e49f47
MD5 f7301dcfdbdf452b73c5718b4978ff33
BLAKE2b-256 4be00f81f445f636a22dc190c18fb42fe4b91076923d3c1a6248c3433582dbd5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nesteddict-0.1.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.2 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.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 bbf7140b6b464b0d1ef02ae36eb0d3b33e67719b32e497def1e018ff4a6fb236
MD5 ef6b8aa974ce3425734e743db3352b2c
BLAKE2b-256 60042ca49406355540db78abf7091a3e0c456521fef1f10b7dbd7aaf0dbe96a1

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