JsonGit: Git Your Dict

Release v0.0.7. (Installation)

Use git as a key-value store to store, track and merge arbitrary data in Python.

>>> r = jsongit.init('repo')
>>> r.commit('foo', {})
>>> r.checkout('foo', 'bar')
>>> r.commit('foo', {'roses': 'red'})
>>> r.commit('bar', {'violets': 'blue'})
>>> r.merge('foo', 'bar').message
Auto-merge of be92d3dcb6 and dbde44bada from shared parent 5d55214e4f
>>> r.show('foo')
{u'roses': u'red', u'violets': u'blue'}
>>> for commit in r.log('foo'):
...     print(commit)
'foo'='{u'roses': u'red', u'violets': u'blue'}'@fc9e0f3106
'bar'='{u'violets': u'blue'}'@be92d3dcb6
'foo'='{u'roses': u'red'}'@dbde44bada

JsonGit layers above the Python packages pygit2 and json_diff to give you logs, merges, diffs, and persistence for any objects that serialize to JSON. It’s licensed BSD.


  • Works with any object that can be serialized as JSON
  • Simple key-value store API
  • Portable, persistent repositories
  • Automatic merging
  • Conflict detection
  • Key-specific logs and signatures

API Documentation

The technical nitty-gritty.

Project Versions

Table Of Contents

Next topic


This Page