Skip to content

T0niMichel/storedDict

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

storedDict

Coverage Status

Build Status

easy json file handling

made for python3, but should be python2 compatible

installation

pip install storedDict

usage

> python3

>>> import storedDict
>>> 
>>> d = storedDict.StoredDict('testfile.json')                                                                                                              
>>> 
>>> d['first'] = 'value'
>>> d['second']['test']['foo'] = 3  # autovivification!
>>> d.commit(indent=2)


> cat testfile.json 
{
  "first": "value",
  "second": {
    "test": {
      "foo": 3
    }
  }
}

if autocommit is set when initializing, the commit will be called automatically on each set!

>>> d = storedDict.StoredDict('testfile.json', autocommit=True)

About

python dictionary wrapper to store as json

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%