Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Dict with json file saving / restoring support

Project description

Dict with json file saving / restoring support

  • datetime, date support
  • readable formated json
  • safely file write with file move os function
  • auto-save support
  • compression support


pip install jsondict


>>> from datetime import datetime
>>> from jsondict import JsonDict
>>> db = JsonDict('var/test.json')
>>> db.clear()
>>> db.update({'b': 2, 'created': datetime(2013, 1, 27, 21, 14), 'a': 1})
>>> open(db.filename).read()
'{\n  "a": 1,\n  "b": 2,\n  "created": "2013-01-27T21:14:00Z"\n}'

Auto-save and compression

>>> import gzip
>>> db = JsonDict('var/test.json.gz', compress=True, autosave=True)
>>> db.clear()
>>> db['x'] = 'y'
'{\n  "x": "y"\n}'

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for jsondict, version 1.2
Filename, size File type Python version Upload date Hashes
Filename, size jsondict-1.2.tar.gz (2.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page