Dot notation python dicationary
Project description
pydotmap
This package is just a wrapper to python standard library dict
. It will allow you to use python dict or dictionary as dot notation just like javascript object.
How to use?
from pydotmap import DotMap
from pydotmap import OrderedDotMap
author = DotMap(name="atul", sirname="singh", addr=[{"country": "India"}])
print(author.name)
print(author.sirname)
del author.sirname
print(author.sirname)
print(author.get("sirname", "singh")) # you can use your default value same as dict
print(author.addr[0].country)
# Ordered Map - This will maintain the order of your dictionary
author = OrderedDotMap(name="atul", sirname="singh", addr=[{"country": "India"}])
print(author)
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
pydotmap-0.0.6.tar.gz
(2.3 kB
view hashes)