Skip to main content

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 dict

  • easily converts to dict

  • subclasses OrderedDict which is ordered by insertion and subclasses dict

m = DotMap()

# key initialization

# 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

# 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.1.tar.gz (1.9 kB view details)

Uploaded Source

File details

Details for the file dotmap-1.0.1.tar.gz.

File metadata

  • Download URL: dotmap-1.0.1.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for dotmap-1.0.1.tar.gz
Algorithm Hash digest
SHA256 057e1b2911cbb8bcf05cbeca91368e747d76c83d7a4b855f3214eed885c9c7b6
MD5 1ce66d46e7c176b88a65483a3705ba39
BLAKE2b-256 69627dd64e9b2086d0b07a96840f7318c81e4355f083c12cbeeb7747502bb935

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page