{ "info": { "author": "Lars Tiede", "author_email": "lars.tiede@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3 :: Only", "Topic :: Database", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "aiorethink\n==========\n\n.. image:: https://img.shields.io/pypi/v/aiorethink.svg\n :alt: PyPI Package latest release\n :target: https://pypi.python.org/pypi/aiorethink\n\n.. image:: https://readthedocs.org/projects/aiorethink/badge/?version=latest\n :target: http://aiorethink.readthedocs.org/en/latest/?badge=latest\n :alt: Documentation Status\n\n.. image:: https://travis-ci.org/lars-tiede/aiorethink.svg?branch=master\n :alt: Travis CI build status\n :target: https://travis-ci.org/lars-tiede/aiorethink\n\n.. image:: https://coveralls.io/repos/github/lars-tiede/aiorethink/badge.svg?branch=master\n :alt: coveralls status\n :target: https://coveralls.io/github/lars-tiede/aiorethink?branch=master\n\n\naiorethink is a fairly comprehensive but easy-to-use asyncio-enabled Object Document Mapper\nfor `RethinkDB `_. It is currently in development.\n\nDocumentation: http://aiorethink.readthedocs.org (very early stages)\n\nSource: https://github.com/lars-tiede/aiorethink\n\n\nSimple example\n--------------\n\n::\n\n import aiorethink as ar\n\n class Hero(ar.Document):\n name = ar.Field(ar.StringValueType(), indexed = True)\n\nThat's all you need to start out with your own documents. More than that,\nactually: declaring and \"typing\" fields is entirely optional.\n\nObviously, you need a RethinkDB instance running, and you need a database\nincluding the tables for your Document classes. aiorethink can't help you with\nthe RethinkDB instance, but the DB setup can be done like so (assuming a\nRethinkDB instance runs on localhost)::\n\n ar.configure_db_connection(db = \"my_db\")\n await ar.init_app_db()\n\nLet's make a document::\n\n spiderman = Hero(name = \"Spiderma\")\n\n # declared fields can be accessed by attribute or dict interface\n spiderman.name = \"Spierman\"\n spiderman[\"name\"] = \"Spiderman\" # third time's the charm\n\n # with the dict interface, we can make and access undeclared fields\n spiderman[\"nickname\"] = \"Spidey\"\n\nValidate and save to DB::\n\n try:\n await spiderman.save() # calls spiderman.validate()\n except ar.ValidationError as e:\n print(\"validation failed, doc not saved: {}\".format(e))\n\n # if we don't declare a primary key field, RethinkDB makes us an 'id' field\n doc_id = spiderman.id\n\nLoad a document from the DB::\n\n spidey = Hero.load(doc_id) # using primary key\n\n spidey = Hero.from_query( # using arbitrary query\n Hero.cq(). # \"class query prefix\", basically rethinkdb.table(\"Heros\")\n get_all(\"Spiderman\", index = \"name\").nth(0)\n )\n\nIterate over a document's RethinkDB changefeed::\n\n async for spidey, changed_keys, change_msg in await spidey.aiter_changes():\n if \"name\" in changed_keys:\n print(\"what, a typo again? {}?\".format(spidey.name))\n\n # change_msg is straight from the rethinkdb changes() query\n\n\nFeatures\n--------\n\nThe following features are either fully or partially implemented:\n\n* optional schema: declare fields in Document classes and get serialization and\n validation magic much like you know it from other ODMs / ORMs. Or don't\n declare fields and just use them with the dictionary interface. Or use a mix\n of declared and undeclared fields.\n* schema for complex fields such as lists, dicts, or even \"sub-documents\" with\n named and typed fields just like documents.\n* ``dict`` interface that works for both declared and undeclared fields.\n* all I/O is is asynchronous, done with ``async def`` / ``await`` style\n coroutines, using asyncio.\n* lazy-loading and caching (i.e. \"awaitable\" fields), for example references\n to other documents.\n* asynchronous changefeeds using ``async for``, on documents and document\n classes. aiorethink can also assist with Python object creation on just about\n any other changefeed.\n\nPlanned features:\n\n* maybe explicit relations between document classes (think \"has_many\" etc.)\n* maybe schema migrations\n\n\nPhilosophy\n----------\n\naiorethink aims to do the following two things very well:\n\n* make translations between database documents and Python objects easy and\n convenient\n* help with schema and validation\n\nOther than that, aiorethink tries not to hide RethinkDB under a too thick\nabstraction layer. RethinkDB's excellent Python driver, and certainly its\nawesome query language, are never far removed and always easy to access. Custom\nqueries on document objects should be easy. Getting document objects out of\nvanilla rethinkdb queries, including changefeeds, should also be easy.\n\n\nStatus\n------\n\naiorethink is in development. The API is not complete and not stable yet,\nalthough the most important features are present now.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/lars-tiede/aiorethink", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "aiorethink", "package_url": "https://pypi.org/project/aiorethink/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/aiorethink/", "project_urls": { "Homepage": "https://github.com/lars-tiede/aiorethink" }, "release_url": "https://pypi.org/project/aiorethink/0.2.1/", "requires_dist": [ "inflection", "rethinkdb" ], "requires_python": "", "summary": "Asynchronous asyncio compatible ODM for RethinkDB", "version": "0.2.1" }, "last_serial": 2175164, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "b7067d49375059e2617c61a5355da35e", "sha256": "a037d1d8557864d229e5a3d2d61e771705b54f4b4061d776d04fbe074b7aa7fd" }, "downloads": -1, "filename": "aiorethink-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "b7067d49375059e2617c61a5355da35e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 18063, "upload_time": "2016-03-25T18:45:52", "url": "https://files.pythonhosted.org/packages/3e/aa/5008fc038837f648926e3ef42ab14aa8f0897d6965c8758339090a936b78/aiorethink-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4f6ef1eae946e7de5c5fcf15ab80286b", "sha256": "0c349fb03e6bddb156865666b40584f6c46658b7d2ffda98051c776c55ea0d33" }, "downloads": -1, "filename": "aiorethink-0.1.0.tar.gz", "has_sig": false, "md5_digest": "4f6ef1eae946e7de5c5fcf15ab80286b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14144, "upload_time": "2016-03-25T18:45:58", "url": "https://files.pythonhosted.org/packages/9b/3a/c779385c7467cdd5f8a83b25cf455468f7fe2a4f213fa9bf8f961b6e70a8/aiorethink-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "0210eb3000c6d2f813019ed9b891a6e3", "sha256": "1f0f20d48b9b6374d1a4b6cddb06303e551c8c2e05150f6087dcbb0321ae6d13" }, "downloads": -1, "filename": "aiorethink-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "0210eb3000c6d2f813019ed9b891a6e3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 29643, "upload_time": "2016-06-18T21:05:10", "url": "https://files.pythonhosted.org/packages/63/e7/8a91e4db431b7b1b6c590e33bbd316b715e533f9a7fb291a5fdec23ddf28/aiorethink-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "00a2beb731374d60fd6d0be22f2891e6", "sha256": "11f5f47f83baa68f2f2ff6d70557648611c704be1adf634311e58a946c6b8203" }, "downloads": -1, "filename": "aiorethink-0.2.0.tar.gz", "has_sig": false, "md5_digest": "00a2beb731374d60fd6d0be22f2891e6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22126, "upload_time": "2016-06-18T21:05:15", "url": "https://files.pythonhosted.org/packages/00/da/ba321b1f3337e9bd69ddaa5457ea493a1a95dc9c4970d57577ebd690deba/aiorethink-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "b41ba7e9ea6cb8ae547163118fd9f090", "sha256": "133d8b4056d8a5e89a3a7e2b988bbfefbed5b8ca0b7f91bf8649cd4cd9ffbebf" }, "downloads": -1, "filename": "aiorethink-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "b41ba7e9ea6cb8ae547163118fd9f090", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 29645, "upload_time": "2016-06-18T21:15:29", "url": "https://files.pythonhosted.org/packages/b2/a0/bd7e39d85d816b913c3610681c04ae1f6f74ce0f3b0083ab0f15293737a3/aiorethink-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ba9c5967af398d1fcc182da5bf980c8f", "sha256": "b2674a7a79cad71147c753a9a8e50366f9fce64e310f6955c972535c6c5b09e0" }, "downloads": -1, "filename": "aiorethink-0.2.1.tar.gz", "has_sig": false, "md5_digest": "ba9c5967af398d1fcc182da5bf980c8f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22122, "upload_time": "2016-06-18T21:15:33", "url": "https://files.pythonhosted.org/packages/98/94/423861a29d18f5038e5a73c40f09a14accd7b5383555ce5bea5db4976beb/aiorethink-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b41ba7e9ea6cb8ae547163118fd9f090", "sha256": "133d8b4056d8a5e89a3a7e2b988bbfefbed5b8ca0b7f91bf8649cd4cd9ffbebf" }, "downloads": -1, "filename": "aiorethink-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "b41ba7e9ea6cb8ae547163118fd9f090", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 29645, "upload_time": "2016-06-18T21:15:29", "url": "https://files.pythonhosted.org/packages/b2/a0/bd7e39d85d816b913c3610681c04ae1f6f74ce0f3b0083ab0f15293737a3/aiorethink-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ba9c5967af398d1fcc182da5bf980c8f", "sha256": "b2674a7a79cad71147c753a9a8e50366f9fce64e310f6955c972535c6c5b09e0" }, "downloads": -1, "filename": "aiorethink-0.2.1.tar.gz", "has_sig": false, "md5_digest": "ba9c5967af398d1fcc182da5bf980c8f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22122, "upload_time": "2016-06-18T21:15:33", "url": "https://files.pythonhosted.org/packages/98/94/423861a29d18f5038e5a73c40f09a14accd7b5383555ce5bea5db4976beb/aiorethink-0.2.1.tar.gz" } ] }