dict object with support for addressing keys in dot notation.
Project description
A light weight extension of the default python dict object. This allows for the use of key names as object attributes.
Simple usage
In [1]: from dotted_dict import DottedDict In [2]: example = DottedDict() In [3]: example['foo'] = 1 In [4]: example.foo Out[4]: 1 In [5]: example.bar = 2 In [6]: example Out[6]: {'bar': 2, 'foo': 1} In [7]: del example['foo'] In [8]: del example.bar In [9]: example Out[9]: {}
Also allows passing in of values in same manner as normal dict objects.
In [10]: example = DottedDict({'foo': 1, 'bar': 2}) In [11]: example Out[11]: {'bar': 2, 'foo': 1}
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
dotted_dict-1.0.0.tar.gz
(2.3 kB
view hashes)
Built Distribution
Close
Hashes for dotted_dict-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cdf9e16fcf9cdb6795e7dd1f761a3519d87b1146b97f76fe54224af52959a9c8 |
|
MD5 | f8b7698b2355df1b9a3e317b1c240ae5 |
|
BLAKE2b-256 | 98733bca1c1efc29348520ddfdb70858476025de6767b43bf4ed4d9563bbf2d2 |