Skip to main content

Git for JSON

Project description

Use Git as a key-value store that can track and merge arbitrary data in Python.

Installation

JsonGit requires that you have installed libgit2. You will also need pygit2 and json_diff, which are available on PyPI.

Example

>>> r = jsongit.repo('repo')
>>> foo = r.commit('foo', {'roses': 'red'})
>>> bar = r.fast_forward('bar', 'foo')
>>> foo['violets'] = 'blue'
>>> foo.commit()
>>> bar['lilacs'] = 'purple'
>>> bar.commit()
>>> merge = foo.merge(bar)
>>> foo.value
{u'roses': u'red', u'lilacs': u'purple', u'violets': u'blue'}
>>> merge.message
u'Auto-merge from dc1ce3d1cc47afd8c5029efccd398d415675d596'
...

Documentation

Documentation is on Read the Docs.

Project details


Supported by

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