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.1.tar.gz
(2.6 kB
view hashes)
Built Distribution
Close
Hashes for dotted_dict-1.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44c0137ce16b562b7c08752a392a1c70c23a6003ade0986776cd9bbbbf129cf7 |
|
MD5 | 66e172dc94b436d114a6e57dd667aa9d |
|
BLAKE2b-256 | 39760af91cd95f6e756a81d8b1ecc520163eb0139252c78026887e9a638ccbdb |