No project description provided
Project description
dottree
An "Enhanced defaultdict", I have been using this construct in my code many time ends up writing the biolerplate getter setter many times. So packed into a module to share with you all.
How to install
- Use pip to install
- tested in Python2
pip install dottree
Quick check
'''
How to use:
- use like a dict
- use like an object
- Go as deep you need
'''
from dottree import dotree as dot
d = dot()
d.M.J = 7
assert d.M.J == 7
assert d['M']['J'] == 7
# downgrade to a dict any time
print dict(d.M) # {'J': 7}
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
dottree-0.1.2.tar.gz
(2.7 kB
view hashes)
Built Distribution
Close
Hashes for dottree-0.1.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd8a6778d78fad64c1f89b20b904441fd9bc0d24fc666c7be53f5c322bff5c7e |
|
MD5 | 5d333fda737973835b36a308235badec |
|
BLAKE2b-256 | 9a0db36180695c1b10348740687610be3cf26997066e48d6597e89bf8a26837c |