{ "info": { "author": "Gabriel Falcao", "author_email": "gabriel@nacaolivre.org", "bugtrack_url": null, "classifiers": [], "description": "GitGraph - A git-backed graph library\n======================================\n\n.. image:: https://travis-ci.org/gabrielfalcao/gitgraph.svg?branch=master\n :target: https://travis-ci.org/gabrielfalcao/gitgraph\n\nInstalation\n-----------\n\n.. code:: bash\n\n pip install gitgraph\n\n\nDeclaring Subjects\n------------------\n\n\n.. code:: python\n\n from gitgraph import GitGraph\n from gitgraph import Subject\n\n store = GitGraph('my-git-cms')\n\n class Document(Subject):\n indexes = {'title'}\n predicates = (\n ('title', codec.Unicode),\n ('body', codec.Unicode),\n ('created_at', codec.DateTime),\n ('published_at', codec.DateTime),\n )\n\n incoming = {\n 'authored_by': Author,\n }\n outgoing = {\n 'contains': Tag,\n }\n\nCreate\n------\n\n.. code:: python\n\n uuid1 = 'deadbeefdeadbeefdeadbeefdeadbeef'\n\n # providing your own uuid\n docs1 = store.create(\n 'Document',\n uuid=uuid1,\n title='Essay',\n body='body1',\n )\n\n # auto-generated uuid\n docs2 = store.create(\n Document,\n title='Blog',\n body='body2',\n )\n\n store.commit()\n\n uuid2 = docs2.uuid\n\n\nRetrieve\n--------\n\nOne By UUID\n~~~~~~~~~~~\n\n.. code:: python\n\n # Using the class Document as subject type\n docs1 = store.get_subject_by_uuid(Document, uuid1)\n\n # Using the subject label\n docs2 = store.get_subject_by_uuid('Document', uuid2)\n\n\nMany By Indexed Predicate\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code:: python\n\n\n from gitgraph.query import predicate\n # functional\n query = lambda title: 'Blog' in title\n\n # DSL\n query = predicate('title').contains('Blog')\n blog_documents = set(store.match_subjects_by_index(Document, 'title', query))\n\n # With Regex\n query = predicate('title').matches('([Bb]log|[Ee]ssa[yi]s?)')\n blogs_and_essays = set(store.match_subjects_by_index(Document, 'title', query))\n\nUpdate\n------\n\n.. code:: python\n\n docs1.title = 'new title'\n\n docs2.title = 'documento dois'\n docs2.body = '
Hello
'\n\n store.merge(docs1, docs2)\n\n # recreate the doc1\n docs1 = store.create(\n Document,\n uuid=uuid1,\n title='Essay',\n body='body1',\n )\n\n\n\nDelete\n------\n\n.. code:: python\n\n store.delete(docs1)\n store.commit()", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/gabrielfalcao/gitgraph", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "gitgraph", "package_url": "https://pypi.org/project/gitgraph/", "platform": "", "project_url": "https://pypi.org/project/gitgraph/", "project_urls": { "Homepage": "https://github.com/gabrielfalcao/gitgraph" }, "release_url": "https://pypi.org/project/gitgraph/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "", "version": "0.1.1" }, "last_serial": 3105433, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "9c336cc0b3273d2b7abef7973ecf0cba", "sha256": "9af0ec45d2381036bd5afb64ad654132759193b03003527598f75bf5436233e5" }, "downloads": -1, "filename": "gitgraph-0.1.0.tar.gz", "has_sig": false, "md5_digest": "9c336cc0b3273d2b7abef7973ecf0cba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14877, "upload_time": "2017-08-18T05:44:45", "url": "https://files.pythonhosted.org/packages/63/20/c7e82a382bdda66f417b2ea95003361f22997abd6f6d38be3b08923ccdaa/gitgraph-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "e293821b705c15e561cad7dccc66bb23", "sha256": "f58de52505320fd168ed403fbabe7e2644aded4a4afeb85f954d0d9e60b0bb9b" }, "downloads": -1, "filename": "gitgraph-0.1.1.tar.gz", "has_sig": false, "md5_digest": "e293821b705c15e561cad7dccc66bb23", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14870, "upload_time": "2017-08-18T05:49:48", "url": "https://files.pythonhosted.org/packages/1d/08/2ede6dffcde2e364a62a1458a548c5bc8b1ddc4699230801b4f9d8685648/gitgraph-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e293821b705c15e561cad7dccc66bb23", "sha256": "f58de52505320fd168ed403fbabe7e2644aded4a4afeb85f954d0d9e60b0bb9b" }, "downloads": -1, "filename": "gitgraph-0.1.1.tar.gz", "has_sig": false, "md5_digest": "e293821b705c15e561cad7dccc66bb23", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14870, "upload_time": "2017-08-18T05:49:48", "url": "https://files.pythonhosted.org/packages/1d/08/2ede6dffcde2e364a62a1458a548c5bc8b1ddc4699230801b4f9d8685648/gitgraph-0.1.1.tar.gz" } ] }