ordered, dynamically-expandable dot-access dictionary
Project description
DotMap is a dot-access dict that
is dynamically expandable
can be initialized with keys
easily initializes from
dicteasily converts to
dictis ordered by insertion
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.3.tar.gz
(1.9 kB
view details)
File details
Details for the file dotmap-1.0.3.tar.gz.
File metadata
- Download URL: dotmap-1.0.3.tar.gz
- Upload date:
- Size: 1.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
491cf3425420a21f69e94a2d06bfc9ac10ef18acd9d9c1ed9e55e292916a2081
|
|
| MD5 |
5bbb547fd79719b16081cd2d10680eb1
|
|
| BLAKE2b-256 |
f7b37852a4610b9efb46fb1bd467e89d4c170ce79d8041668ef6a7137ce8ec9d
|