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.3.tar.gz
(2.8 kB
view hashes)
Built Distribution
Close
Hashes for dottree-0.1.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c03e6607287ecbdc78f34ec845ac410c8f2a287168ce2acb7e635e8c69b45d38 |
|
MD5 | 11186c28eafb29ece6437eebc0e0ff58 |
|
BLAKE2b-256 | 6238d42ba28dc6c94ac0f4b07fe091e2b9aa467b60127ca2eee76178ed7e578c |