{ "info": { "author": "Andrew Bentley", "author_email": "andrew.t.bentley@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.5", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "aiohttp_rest\n============\n\naiohttp_rest makes it easy to create RESTful aiohttp endpoints that bind directly to models with minimal modification.\n\nUsage\n-----\n\nCreate your model:\n\n.. code-block:: python\n\n class Person:\n def __init__(self, name, age):\n self.name = name\n self.age = age\n\nCreate an aiohttp application that makes use of a ``aiohttp_rest.RestResource``:\n\n.. code-block:: python\n\n from aiohttp.web import Application, run_app\n from aiohttp_rest import RestResource\n\n from person import Person\n\n\n people = {}\n\n app = Application()\n person_resource = RestResource('people', people, Person, ('name', 'age'), 'name')\n person_resource.register(app.router)\n\n run_app(app)\n\nInteract with the API:\n\n.. code-block:: bash\n\n http POST localhost:8000/people name=andrew age=24\n http localhost:8000/people/andrew\n http PUT localhost:8000/people/andrew/age age=25\n http DELETE localhost:8000/people/andrew\n\nSeveral things are required by the ``RestResource`` to make all this work:\n\n- A name for the resource, this will form the base of the URL.\n- A factory method for the model, as seen above, this can simply be the init method for the model or something more complex.\n- A collection to store the models, this should be a ``dict``-like object.\n- A list of properties to expose to the API.\n- A property to treat as the id for the collection. In the above example we used the name as the id, so that's what we used in our URLs to refer to a specific instance in the collection.\n\nInstalling\n----------\n\n.. code-block::\n\n git clone github.com/atbentley/aiohttp_rest\n cd aiohttp_rest\n python setup.py install\n\nTests\n-----\n\n.. code-block::\n\n pip install -r build-requirements.txt\n py.test tests\n\nLicense\n-------\n\nMIT", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/atbentley/aiohttp-rest/", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "aiohttp-rest", "package_url": "https://pypi.org/project/aiohttp-rest/", "platform": "any", "project_url": "https://pypi.org/project/aiohttp-rest/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/atbentley/aiohttp-rest/" }, "release_url": "https://pypi.org/project/aiohttp-rest/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "RESTful endpoints for aoihttp that bind directly to a model", "version": "0.1.0" }, "last_serial": 2041497, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "b60e06c81f548b33f4eed4cd3a0a4400", "sha256": "5de15a5367fcae9763c2d165791293b0bd24a32a8e8533c442a04269ad4072bc" }, "downloads": -1, "filename": "aiohttp-rest-0.1.0.tar.gz", "has_sig": false, "md5_digest": "b60e06c81f548b33f4eed4cd3a0a4400", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6776, "upload_time": "2016-04-02T06:32:26", "url": "https://files.pythonhosted.org/packages/ed/d7/5bb4014e4980368c6a06a0a12f8ffb59062729d59e421f0203a4af76d15e/aiohttp-rest-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b60e06c81f548b33f4eed4cd3a0a4400", "sha256": "5de15a5367fcae9763c2d165791293b0bd24a32a8e8533c442a04269ad4072bc" }, "downloads": -1, "filename": "aiohttp-rest-0.1.0.tar.gz", "has_sig": false, "md5_digest": "b60e06c81f548b33f4eed4cd3a0a4400", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6776, "upload_time": "2016-04-02T06:32:26", "url": "https://files.pythonhosted.org/packages/ed/d7/5bb4014e4980368c6a06a0a12f8ffb59062729d59e421f0203a4af76d15e/aiohttp-rest-0.1.0.tar.gz" } ] }