Skip to main content

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}

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)

Uploaded source

Built Distribution

dottree-0.1.3-py2.py3-none-any.whl (3.5 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page