{ "info": { "author": "Johannes Krattenmacher", "author_email": "python@krateng.dev", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# PyAPI\n\nA simple Bottle.py-wrapper to provide HTTP API access to any python object.\n\n# Requirements\n\n* [python3](https://www.python.org/) - [GitHub](https://github.com/python/cpython)\n* [bottle.py](https://bottlepy.org/) - [GitHub](https://github.com/bottlepy/bottle)\n* [waitress](https://docs.pylonsproject.org/projects/waitress/) - [GitHub](https://github.com/Pylons/waitress)\n\n# Quick Start\n\nInstall with\n\n```\npip install APyI\n```\n\nCreate your API with\n\n```python\n\nfrom PyAPI import API\n\nmyapi = API()\n```\n\nYou can pass a port number with `port=42`, a path with `path=\"api\"` and whether you want to serve on IPv4 (`IPv6=False`).\nYou can also give the API object an existing bottle server (`server=bottleobject`), in which case your API will be served on the existing server. In this case, it is heavily recommended to pass a path variable to separate API from regular routing of your server.\n\n\nThen make any class accessible with a decorator.\n\n```python\n\n@myapi.apiclass(\"group\")\nclass Group:\n\n\tdef __init__(self,name,apipath,songs):\n\t\t# some stuff\n\t\tself.__apiname__ = apipath\n```\n\nAny instance of that class is now accessible via the combination of class path and its individual path. Now just decorate the methods. All its arguments can be passed via URI query arguments.\n\n```python\n\t@myapi.get(\"songs\")\n\tdef get_songs(self,member):\n\t\treturn {\"songs\":[s[\"title\"] for s in self.songs if member in s[\"performers\"]]}\n```\n\nNow create an object and make sure it has an `__apiname__` attribute:\n\n```python\ne = Group(\"Exid\",\"exid\",exidsongs)\n```\n\nThen you can access its methods with simple HTTP calls:\n\n\n\tHTTP GET http://localhost:1337/group/exid/songs?member=Junghwa\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/krateng/PyAPI", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "APyI", "package_url": "https://pypi.org/project/APyI/", "platform": "", "project_url": "https://pypi.org/project/APyI/", "project_urls": { "Homepage": "https://github.com/krateng/PyAPI" }, "release_url": "https://pypi.org/project/APyI/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "Bottle.py wrapper to make python objects accessible via HTTP API", "version": "0.1.1" }, "last_serial": 5272879, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "ab0c4b4227c55859784bb247699f483b", "sha256": "06c4fa7319100dd2cd350006f5f6ecccf848e2ec35ad19e7851a48da62a323a9" }, "downloads": -1, "filename": "APyI-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "ab0c4b4227c55859784bb247699f483b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15534, "upload_time": "2019-05-03T15:31:10", "url": "https://files.pythonhosted.org/packages/c6/90/1d82e27cc350707993bcd19d499758ef0b9434e38ddb5802e81fba92b8ee/APyI-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "733bdaf80fdf200f4e9354451b0b1557", "sha256": "05f01b01ec4ce6c119304aad9b3d71f3190cb11b6ec539bf9c1c9208157116ec" }, "downloads": -1, "filename": "APyI-0.1.tar.gz", "has_sig": false, "md5_digest": "733bdaf80fdf200f4e9354451b0b1557", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2969, "upload_time": "2019-05-15T14:55:49", "url": "https://files.pythonhosted.org/packages/23/61/2a9fdf118ca6b7646868b634557a866e708bbdf501cca5d507def64d68a7/APyI-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "37914f8a4eeb26c0d17e2114bffe26f4", "sha256": "bfe79a8f3fe7aa15726e50d48bd75b29f811dee327f2db2e54ca83b1d97dcb2d" }, "downloads": -1, "filename": "APyI-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "37914f8a4eeb26c0d17e2114bffe26f4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15988, "upload_time": "2019-05-15T14:55:45", "url": "https://files.pythonhosted.org/packages/fd/82/3ceaf50b0474d71ae778b9e68e8f7ab863c663ab473730755647b7b43df8/APyI-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "537fea6ac40888cf591ddca827e20327", "sha256": "c815526d542c3693fe2aa3ad142d8297f5222ca48e735a57a66aacb0605a8d6a" }, "downloads": -1, "filename": "APyI-0.1.1.tar.gz", "has_sig": false, "md5_digest": "537fea6ac40888cf591ddca827e20327", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3413, "upload_time": "2019-05-15T14:55:47", "url": "https://files.pythonhosted.org/packages/48/c3/0252039151b0ddbc6aae647a05d9d86e30d20cf905ca5a44f79ae5ae85ff/APyI-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "37914f8a4eeb26c0d17e2114bffe26f4", "sha256": "bfe79a8f3fe7aa15726e50d48bd75b29f811dee327f2db2e54ca83b1d97dcb2d" }, "downloads": -1, "filename": "APyI-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "37914f8a4eeb26c0d17e2114bffe26f4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15988, "upload_time": "2019-05-15T14:55:45", "url": "https://files.pythonhosted.org/packages/fd/82/3ceaf50b0474d71ae778b9e68e8f7ab863c663ab473730755647b7b43df8/APyI-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "537fea6ac40888cf591ddca827e20327", "sha256": "c815526d542c3693fe2aa3ad142d8297f5222ca48e735a57a66aacb0605a8d6a" }, "downloads": -1, "filename": "APyI-0.1.1.tar.gz", "has_sig": false, "md5_digest": "537fea6ac40888cf591ddca827e20327", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3413, "upload_time": "2019-05-15T14:55:47", "url": "https://files.pythonhosted.org/packages/48/c3/0252039151b0ddbc6aae647a05d9d86e30d20cf905ca5a44f79ae5ae85ff/APyI-0.1.1.tar.gz" } ] }