Skip to content

gitbackspacer/dottree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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}

About

Enhance defaultdict

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages