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
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 Distribution
nesteddict-0.1.2a3.tar.gz
(5.5 kB
view details)
Built Distribution
File details
Details for the file nesteddict-0.1.2a3.tar.gz
.
File metadata
- Download URL: nesteddict-0.1.2a3.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfa8e3bcbf653356b5821727964e7cf3febbdb3f995a501c157f62f39eb51445 |
|
MD5 | 991c404bbef9215fff3f4493954118c1 |
|
BLAKE2b-256 | 43f7651d15046454a6249bbe1bf6e9910ec48486f1ae058945ca4f468b0c0a44 |
File details
Details for the file nesteddict-0.1.2a3-py2.py3-none-any.whl
.
File metadata
- Download URL: nesteddict-0.1.2a3-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | beb2ca63c7d3ecbab920ab17ac6da895496931e15e9823a5dc0b443b625e31e9 |
|
MD5 | 165cb32504fe86b7f25703d370e60bbb |
|
BLAKE2b-256 | 38e0b213f355c1369ba23724537d23d1667bc808280c472cdbd2d7a886a5d511 |