{ "info": { "author": "Marc Brinkmann", "author_email": "git@marcbrinkmann.de", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python :: 2", "Programming Language :: Python :: 3" ], "description": "tinydb-git\n==========\n\nA storage backend for tinydb that stores database changes inside a git\nbranch.\n\n``tinydb-git`` lets you use any branch in a git repository as a backend for\ntinydb_.\n\n.. code-block:: sh\n\n hiro@wintermute:tmp$ git init example\n Initialized empty Git repository in /tmp/example/.git/\n\nEvery modification of the database results in a new commit:\n\n.. code-block:: pycon\n\n >>> import tinydb\n >>> from tinydb_git.json import JSONGitStorage\n >>> db = tinydb.TinyDB('example', storage=JSONGitStorage)\n >>> db.insert({'text': 'first record'})\n 1\n\n.. code-block:: sh\n\n hiro@wintermute:example$ git log\n commit de9a07844783b8e420fce6f9568e126dd7779e74\n\n Updated by tinydb-git 0.1.dev1\n\n commit 3b31825cf312cb5d42f792998faddf20b634c7d9\n\n Updated by tinydb-git 0.1.dev1\n\nMultiple ``insert()`` calls result in a commit for each call. This can be\navoided by using a tinyrecord_ transaction:\n\n.. code-block:: pycon\n\n >>> from tinyrecord import transaction\n >>> with transaction(db.table('_default')) as t:\n ... t.insert({'b': 2})\n ... t.insert({'c': 3})\n ... t.insert({'d': 4})\n ...\n >>>\n\nThe result:\n\n.. code-block:: sh\n\n hiro@wintermute:example$ git log\n commit e02a3af06d7cd7eeb6990277777cc24d384249e8\n\n Updated by tinydb-git 0.1.dev1\n\n commit de9a07844783b8e420fce6f9568e126dd7779e74\n\n Updated by tinydb-git 0.1.dev1\n\n commit 3b31825cf312cb5d42f792998faddf20b634c7d9\n\n Updated by tinydb-git 0.1.dev1\n\nInternally, data gets stored as json, with ``sort_keys=True`` and ``indent=2``,\nto make diffs pleasant to read and help with compression:\n\n.. code-block:: sh\n\n hiro@wintermute:example$ git diff master^ master\n diff --git a/tinydb.json b/tinydb.json\n index a27ff44..d9711f0 100644\n --- a/tinydb.json\n +++ b/tinydb.json\n @@ -2,6 +2,15 @@\n \"_default\": {\n \"1\": {\n \"text\": \"first record\"\n + },\n + \"2\": {\n + \"b\": 2\n + },\n + \"3\": {\n + \"c\": 3\n + },\n + \"4\": {\n + \"d\": 4\n }\n }\n }\n \\ No newline at end of file\n\nYAML\n~~~~\n\nAlternatively, data can be stored as YAML, which allows things like\n`datetime`-Instances to be represented correctly:\n\n.. code-block:: pycon\n\n >>> import tinydb\n >>> from tinydb_git.yaml import YAMLGitStoroage\n >>> db = tinydb.TinyDB('example', storage=YAMLGitStoroage)\n\n.. _tinydb: http://tinydb.readthedocs.org/\n.. _tinyrecord: https://github.com/eugene-eeo/tinyrecord", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mbr/tinydb-git", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "tinydb-git", "package_url": "https://pypi.org/project/tinydb-git/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/tinydb-git/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/mbr/tinydb-git" }, "release_url": "https://pypi.org/project/tinydb-git/0.2/", "requires_dist": null, "requires_python": null, "summary": "A git-based storage backend for tinydb.", "version": "0.2" }, "last_serial": 1787558, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "847fcd90d27413313da9a723a3987c0f", "sha256": "59bf135b36afb2fb9db1cf98dc99fc9d2109649fdb88f5ac77fdcdf2e12c7940" }, "downloads": -1, "filename": "tinydb-git-0.1.tar.gz", "has_sig": true, "md5_digest": "847fcd90d27413313da9a723a3987c0f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3012, "upload_time": "2015-10-22T17:37:20", "url": "https://files.pythonhosted.org/packages/83/f2/4312a93b2f2111d6ddcb1565f85666e262aa5099caa63a760472cf258f6a/tinydb-git-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "67e6177e8479b45a4c8014ef4193a0b9", "sha256": "8ec6304d8695bd412f7e7b1a3433fb6ac4853ba2bd70eb6d204f4bca5448d111" }, "downloads": -1, "filename": "tinydb-git-0.2.tar.gz", "has_sig": true, "md5_digest": "67e6177e8479b45a4c8014ef4193a0b9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3531, "upload_time": "2015-10-26T23:45:54", "url": "https://files.pythonhosted.org/packages/c5/d9/d16226b1344ddb2f6d4c92788ddbc463d7aa8bd404471016a5c227d75a84/tinydb-git-0.2.tar.gz" } ], "0.2.dev1": [] }, "urls": [ { "comment_text": "", "digests": { "md5": "67e6177e8479b45a4c8014ef4193a0b9", "sha256": "8ec6304d8695bd412f7e7b1a3433fb6ac4853ba2bd70eb6d204f4bca5448d111" }, "downloads": -1, "filename": "tinydb-git-0.2.tar.gz", "has_sig": true, "md5_digest": "67e6177e8479b45a4c8014ef4193a0b9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3531, "upload_time": "2015-10-26T23:45:54", "url": "https://files.pythonhosted.org/packages/c5/d9/d16226b1344ddb2f6d4c92788ddbc463d7aa8bd404471016a5c227d75a84/tinydb-git-0.2.tar.gz" } ] }