This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

A storage backend for tinydb that stores database changes inside a git branch.

tinydb-git lets you use any branch in a git repository as a backend for tinydb.

hiro@wintermute:tmp$ git init example
Initialized empty Git repository in /tmp/example/.git/

Every modification of the database results in a new commit:

>>> import tinydb
>>> from tinydb_git.json import JSONGitStorage
>>> db = tinydb.TinyDB('example', storage=JSONGitStorage)
>>> db.insert({'text': 'first record'})
1
hiro@wintermute:example$ git log
commit de9a07844783b8e420fce6f9568e126dd7779e74

    Updated by tinydb-git 0.1.dev1

commit 3b31825cf312cb5d42f792998faddf20b634c7d9

    Updated by tinydb-git 0.1.dev1

Multiple insert() calls result in a commit for each call. This can be avoided by using a tinyrecord transaction:

>>> from tinyrecord import transaction
>>> with transaction(db.table('_default')) as t:
...         t.insert({'b': 2})
...         t.insert({'c': 3})
...         t.insert({'d': 4})
...
>>>

The result:

hiro@wintermute:example$ git log
commit e02a3af06d7cd7eeb6990277777cc24d384249e8

    Updated by tinydb-git 0.1.dev1

commit de9a07844783b8e420fce6f9568e126dd7779e74

    Updated by tinydb-git 0.1.dev1

commit 3b31825cf312cb5d42f792998faddf20b634c7d9

    Updated by tinydb-git 0.1.dev1

Internally, data gets stored as json, with sort_keys=True and indent=2, to make diffs pleasant to read and help with compression:

hiro@wintermute:example$ git diff master^ master
diff --git a/tinydb.json b/tinydb.json
index a27ff44..d9711f0 100644
--- a/tinydb.json
+++ b/tinydb.json
@@ -2,6 +2,15 @@
   "_default": {
     "1": {
       "text": "first record"
+    },
+    "2": {
+      "b": 2
+    },
+    "3": {
+      "c": 3
+    },
+    "4": {
+      "d": 4
     }
   }
 }
\ No newline at end of file

YAML

Alternatively, data can be stored as YAML, which allows things like datetime-Instances to be represented correctly:

>>> import tinydb
>>> from tinydb_git.yaml import YAMLGitStoroage
>>> db = tinydb.TinyDB('example', storage=YAMLGitStoroage)
Release History

Release History

0.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.dev1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
tinydb-git-0.2.tar.gz (3.5 kB) Copy SHA256 Checksum SHA256 Source Oct 26, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting