Skip to content

vkuznet/DotDict

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Description:
------------

DotDict is an extension of python dictionary which uses and operates
with dot notations. For example, DotDict.get('a.b.c') or simply 
DotDict['a.b.c']. It extends set/get operations to set/assign new
values, as well as provide get_keys/get_values/delete APIs. It also
smart enough to work with complex dict structures. Here is a few
examples:

    from ddict import DotDict
    row = {'a':{'b':1, 'c':[1,2]}}
    rec = DotDict(row)
    print rec['a.c']
    [1,2]
    rec['x.y.z'] = 1
    print rec
    {'a':{'b':1, 'c':[1,2]}, 'x': {'y': {'z': 1}}

For a complete list of examples, see ddict_t.py unit test module.    

About

Python dictionary extension via dot notations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages