Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

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

Project description


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.

Files for nesteddict, version 0.1a2
Filename, size File type Python version Upload date Hashes
Filename, size nesteddict-0.1a2-py2.py3-none-any.whl (5.6 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size nesteddict-0.1a2.tar.gz (2.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page