{ "info": { "author": "Jonathan Frere", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3 :: Only", "Topic :: Database" ], "description": "OGitM\r\n=====\r\n\r\n**Because doing stupid things with git is surprisingly fun.**\r\n\r\n\r\n.. image:: https://travis-ci.org/MrJohz/ogitm.svg?branch=master\r\n :target: https://travis-ci.org/MrJohz/ogitm\r\n :alt: Build Status\r\n.. image:: https://coveralls.io/repos/MrJohz/ogitm/badge.svg?branch=master\r\n :target: https://coveralls.io/r/MrJohz/ogitm?branch=master\r\n :alt: Coverage Status\r\n.. image:: https://readthedocs.org/projects/ogitm/badge/?version=latest\r\n :target: https://readthedocs.org/projects/ogitm/?badge=latest\r\n :alt: Documentation Status\r\n\r\n\r\nOGitM is an ORM, but where the relational database that underlies the entire\r\nmapping has been replaced by an awful attempt at replicating a stupidly basic\r\nkey-value document store in git_. This software should never be used by\r\nanyone ever. Please, for the good of humanity.\r\n\r\n.. _git: http://git-scm.com/\r\n\r\n\r\nUm... What?\r\n-----------\r\n\r\nGit is useful, because it stores both data, and the history of that data.\r\nThis might be a useful property for a database to have. Writing a whole\r\ndatabase based on git is boring, I should try writing an ORM to wrap around\r\nit. Well, it wouldn't so much be an ORM, more an O... git M?\r\n\r\n\r\nHow do I use this?\r\n---------------------\r\n\r\nImport the module, declare your model, and go!\r\n\r\n.. code-block:: pycon\r\n\r\n >>> import tempfile; db_directory = tempfile.TemporaryDirectory()\r\n >>>\r\n >>> import ogitm\r\n >>> class MyModel(ogitm.Model, db=db_directory.name):\r\n ... name = ogitm.fields.String()\r\n ... age = ogitm.fields.Integer(min=0)\r\n >>>\r\n >>> instance = MyModel(name=\"Bob\", age=172)\r\n >>> instance_id = instance.save()\r\n >>> MyModel.find(name=\"Bob\", age=172).first() == instance\r\n True\r\n >>> instance.age = -5\r\n Traceback (most recent call last):\r\n ...\r\n ValueError: Disallowed value -5 ...\r\n\r\n\r\nCan I get at the underlying database?\r\n-------------------------------------\r\n\r\nYes. Meet the gitdb module, which provides direct access to a document-based\r\ndatabase. Initialise it with a directory that it can use as a git bare\r\nrepository, and start inserting and getting.\r\n\r\n.. code-block:: pycon\r\n\r\n >>> import tempfile; db_directory = tempfile.TemporaryDirectory()\r\n >>>\r\n >>> from ogitm import gitdb\r\n >>> db = gitdb.GitDB(db_directory.name)\r\n >>> doc_id = db.insert({'name': 'Jimmy', 'age': 45, 'car': False})\r\n >>> db.get(doc_id) == {'name': 'Jimmy', 'age': 45, 'car': False}\r\n True\r\n\r\nMore than that, you can also search for documents previously inserted. These\r\nqueries accept simple scalar arguments, which return all documents which have\r\nthe same values as the query, and more complex dictionary arguments which can\r\ntest for existence, compare etc.\r\n\r\n.. code-block:: pycon\r\n\r\n >>> doc_id = db.insert({'name': 'Bobbie', 'car': True})\r\n >>> doc_id = db.insert({'name': 'Bertie', 'age': 26, 'car': False})\r\n >>> {'name': 'Bobbie', 'car': True} in db.find_items({'car': True})\r\n True\r\n >>> doc_id = db.insert({'name': 'Jimmy'})\r\n >>> db.find_items({'car': {'exists': False}}) == [{'name': 'Jimmy'}]\r\n True\r\n\r\n\r\nTodo\r\n----\r\n\r\n- Documentation. (docstrings & manual)\r\n- PyPI\r\n- Relationships? (U f*cking wot m8?)\r\n- Python 2\r\n- Better way of accessing git (May be needed for Py2, is needed for pypy, will\r\n make it easier for anyone to install it from PyPI) (See Dulwich)\r\n- Begin versioning sometime fairly soon", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/MrJohz/ogitm", "keywords": "git database", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "ogitm", "package_url": "https://pypi.org/project/ogitm/", "platform": "", "project_url": "https://pypi.org/project/ogitm/", "project_urls": { "Homepage": "https://github.com/MrJohz/ogitm" }, "release_url": "https://pypi.org/project/ogitm/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "A OO-based Git Database", "version": "0.1.0" }, "last_serial": 1478664, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "88abd92fd63efd2ea6f210f05763766f", "sha256": "0c31fa4ceb506f1b40172113ca40f2dd28113b1e478de4fd1535742cc0ef8c9c" }, "downloads": -1, "filename": "ogitm-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "88abd92fd63efd2ea6f210f05763766f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11485, "upload_time": "2015-03-26T13:50:14", "url": "https://files.pythonhosted.org/packages/99/50/05db3d7c5484e49dec98b87377e9293dde49b602f29fd498ce8d148a20c9/ogitm-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ea4681ac488e8e24a1ada2b50fbb0655", "sha256": "5b99563d9baae442cd2177de80b7a671d1459d28f815c26e355b71e21288cab3" }, "downloads": -1, "filename": "ogitm-0.1.0.tar.gz", "has_sig": false, "md5_digest": "ea4681ac488e8e24a1ada2b50fbb0655", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13324, "upload_time": "2015-03-26T13:50:17", "url": "https://files.pythonhosted.org/packages/29/df/a8fd98734ef48cc3806132e6173b381fa887668a2f76d770025290944ddc/ogitm-0.1.0.tar.gz" } ], "0.1.0b1": [ { "comment_text": "", "digests": { "md5": "a92b8559c122ab405bf4abe06e8f65b5", "sha256": "13559f3fe4dd3bb3e16ae4700481577bbcc8f0f8e132a86b3661d1439c0b9030" }, "downloads": -1, "filename": "ogitm-0.1.0b1-py3-none-any.whl", "has_sig": false, "md5_digest": "a92b8559c122ab405bf4abe06e8f65b5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11524, "upload_time": "2015-03-26T13:49:28", "url": "https://files.pythonhosted.org/packages/3b/54/cad74ade2f313eda4169d59414c0ecf026466abe572cd50eba7a312534f7/ogitm-0.1.0b1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "24f1bc0b91527cdd1c0c72dbf0b0bb8f", "sha256": "6d899dc447310f7b7aabc1caf3d9f2b0e744bcf767e7870fab1574edc8f92ebd" }, "downloads": -1, "filename": "ogitm-0.1.0b1.tar.gz", "has_sig": false, "md5_digest": "24f1bc0b91527cdd1c0c72dbf0b0bb8f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13317, "upload_time": "2015-03-26T13:49:31", "url": "https://files.pythonhosted.org/packages/f3/9a/596652245fc3187704c74ad87f6b981ab3e1a3052b4c306d98851073f80f/ogitm-0.1.0b1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "88abd92fd63efd2ea6f210f05763766f", "sha256": "0c31fa4ceb506f1b40172113ca40f2dd28113b1e478de4fd1535742cc0ef8c9c" }, "downloads": -1, "filename": "ogitm-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "88abd92fd63efd2ea6f210f05763766f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11485, "upload_time": "2015-03-26T13:50:14", "url": "https://files.pythonhosted.org/packages/99/50/05db3d7c5484e49dec98b87377e9293dde49b602f29fd498ce8d148a20c9/ogitm-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ea4681ac488e8e24a1ada2b50fbb0655", "sha256": "5b99563d9baae442cd2177de80b7a671d1459d28f815c26e355b71e21288cab3" }, "downloads": -1, "filename": "ogitm-0.1.0.tar.gz", "has_sig": false, "md5_digest": "ea4681ac488e8e24a1ada2b50fbb0655", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13324, "upload_time": "2015-03-26T13:50:17", "url": "https://files.pythonhosted.org/packages/29/df/a8fd98734ef48cc3806132e6173b381fa887668a2f76d770025290944ddc/ogitm-0.1.0.tar.gz" } ] }