ordered, dynamically-expandable dot-access dictionary
Project description
DotMap is a dot-access dictionary that
is dynamically expandable
can be initialized with keys
easily initializes from
dicteasily converts to
dictis ordered by insertion
from dotmap import DotMap
m = DotMap()
# new sub maps are created dynamically
m.people.john.age = 32
m.people.john.job = 'programmer'
m.people.mary.age = 24
m.people.mary.job = 'designer'
# iteration ordered by insertion
for k, v in m.people.items():
print k, v
print
# key initialization
m = DotMap(a=1, b=2)
# easy conversion to dictionary
d = m.toDict()
# easy initialization from dictionary
newMap = DotMap(d)
print newMap
# built-in pprint
newMap.pprint()
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
dotmap-1.0.13.tar.gz
(2.0 kB
view details)
File details
Details for the file dotmap-1.0.13.tar.gz.
File metadata
- Download URL: dotmap-1.0.13.tar.gz
- Upload date:
- Size: 2.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8460ffad7b83991dcab976cd77cd6cbed58ddc0aecc647b811b3de8a27b7e6ea
|
|
| MD5 |
3818021acee6d1928b1492a989f14a7d
|
|
| BLAKE2b-256 |
85f1e6938d0f3998ff7d9bbd608855fb197edeab2ee78e97932fad18c39bf4e7
|