{ "info": { "author": "Ashley Sommer", "author_email": "ashleysommer@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: System :: Software Distribution" ], "description": "==============\nSanic RestPlus\n==============\n\nSanic-RESTPlus is an extension for `Sanic`_ that adds support for quickly building REST APIs.\nSanic-RESTPlus encourages best practices with minimal setup.\nIf you are familiar with Sanic, Sanic-RESTPlus should be easy to pick up.\nIt provides a coherent collection of decorators and tools to describe your API\nand expose its documentation properly using `Swagger`_.\n\n\nCompatibility\n=============\n\nSanic-RestPlus requires Python 3.5+.\n\n\nInstallation\n============\n\nIn the near future, you will be able to install Sanic-Restplus with pip:\n\n.. code-block:: console\n\n $ pip install sanic-restplus\n\nor with easy_install:\n\n.. code-block:: console\n\n $ easy_install sanic-restplus\n\n\nQuick start\n===========\n\nWith Sanic-Restplus, you only import the api instance to route and document your endpoints.\n\n.. code-block:: python\n\n from sanic import Sanic\n from sanic_restplus import Api, Resource, fields\n from sanic_restplus.restplus import restplus\n from spf import SanicPluginsFramework\n app = Sanic(__name__)\n spf = SanicPluginsFramework(app)\n rest_assoc = spf.register_plugin(restplus)\n\n api = Api(version='1.0', title='TodoMVC API',\n description='A simple TodoMVC API')\n\n ns = api.namespace('todos', description='TODO operations')\n\n todo = api.model('Todo', {\n 'id': fields.Integer(readOnly=True, description='The task unique identifier'),\n 'task': fields.String(required=True, description='The task details')\n })\n\n\n class TodoDAO(object):\n def __init__(self):\n self.counter = 0\n self.todos = []\n\n def get(self, id):\n for todo in self.todos:\n if todo['id'] == id:\n return todo\n api.abort(404, \"Todo {} doesn't exist\".format(id))\n\n def create(self, data):\n todo = data\n todo['id'] = self.counter = self.counter + 1\n self.todos.append(todo)\n return todo\n\n def update(self, id, data):\n todo = self.get(id)\n todo.update(data)\n return todo\n\n def delete(self, id):\n todo = self.get(id)\n self.todos.remove(todo)\n\n\n DAO = TodoDAO()\n DAO.create({'task': 'Build an API'})\n DAO.create({'task': '?????'})\n DAO.create({'task': 'profit!'})\n\n\n @ns.route('/')\n class TodoList(Resource):\n '''Shows a list of all todos, and lets you POST to add new tasks'''\n\n @ns.doc('list_todos')\n @ns.marshal_list_with(todo)\n async def get(self, request):\n '''List all tasks'''\n return DAO.todos\n\n @ns.doc('create_todo')\n @ns.expect(todo)\n @ns.marshal_with(todo, code=201)\n async def post(self, request):\n '''Create a new task'''\n return DAO.create(request.json), 201\n\n\n @ns.route('/')\n @ns.response(404, 'Todo not found')\n @ns.param('id', 'The task identifier')\n class Todo(Resource):\n '''Show a single todo item and lets you delete them'''\n\n @ns.doc('get_todo')\n @ns.marshal_with(todo)\n async def get(self, request, id):\n '''Fetch a given resource'''\n return DAO.get(id)\n\n @ns.doc('delete_todo')\n @ns.response(204, 'Todo deleted')\n async def delete(self, request, id):\n '''Delete a task given its identifier'''\n DAO.delete(id)\n return '', 204\n\n @ns.expect(todo)\n @ns.marshal_with(todo)\n async def put(self, request, id):\n '''Update a task given its identifier'''\n return DAO.update(id, request.json)\n\n rest_assoc.api(api)\n\n if __name__ == '__main__':\n app.run(debug=True, auto_reload=False)\n\n\n\n\nDocumentation\n=============\n\nThe documentation is hosted `on Read the Docs `_\nThat is the Flask RestPlus documentation, the Sanic-Restplus docs are not converted yet.\n\n.. _Sanic: https://github.com/channelcat/sanic\n.. _Swagger: http://swagger.io/\n\nREMOVED Flask-Restplus changelog. See the flask-restplus changelog in the relevant parent repostiory.\n\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ashleysommer/sanic-restplus", "keywords": "sanic restplus rest api swagger openapi", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "sanic-restplus", "package_url": "https://pypi.org/project/sanic-restplus/", "platform": "", "project_url": "https://pypi.org/project/sanic-restplus/", "project_urls": { "Homepage": "https://github.com/ashleysommer/sanic-restplus" }, "release_url": "https://pypi.org/project/sanic-restplus/0.4.0.post1/", "requires_dist": [ "aniso8601 (>=0.82)", "jsonschema", "methodtools", "sanic (>=0.8.3)", "sanic-jinja2-spf (>=0.7.5)", "sanic-plugins-framework (>=0.8.2)", "pytz", "alabaster (==0.7.12) ; extra == 'doc'", "Sphinx (==2.1.2) ; extra == 'doc'", "sphinx-issues (==1.2.0) ; extra == 'doc'", "blinker ; extra == 'test'", "mock (==2.0.0) ; extra == 'test'", "pytest (<4.6.0) ; extra == 'test'", "pytest-benchmark (==3.2.2) ; extra == 'test'", "pytest-cov (==2.7.1) ; extra == 'test'", "pytest-faker (==2.0.0) ; extra == 'test'", "pytest-sanic ; extra == 'test'", "pytest-mock (==1.10.4) ; extra == 'test'", "pytest-profiling (==1.7.0) ; extra == 'test'", "pytest-sugar (==0.9.2) ; extra == 'test'", "tzlocal ; extra == 'test'" ], "requires_python": "", "summary": "Fully featured framework for fast, easy and documented API development with Sanic", "version": "0.4.0.post1" }, "last_serial": 5847917, "releases": { "0.3.3": [ { "comment_text": "", "digests": { "md5": "735d64c4c55fa22b39390621789eac46", "sha256": "ac2bfed2ade4139eb4be56ff9dd455d570fa6a37fd8fd88c88e40267332332a1" }, "downloads": -1, "filename": "sanic_restplus-0.3.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "735d64c4c55fa22b39390621789eac46", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 2488600, "upload_time": "2019-05-28T04:32:20", "url": "https://files.pythonhosted.org/packages/52/db/894077b028df1a4ba4f9968b8ce441cd055e9ef8bc60a9ae8ad991db7cae/sanic_restplus-0.3.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c678bb6547d190cfa970a7509e4d21f5", "sha256": "3085ab231520b4508f7cf4813a539b6c6b48c84c7118cfaedf20012f91870a38" }, "downloads": -1, "filename": "sanic-restplus-0.3.3.tar.gz", "has_sig": false, "md5_digest": "c678bb6547d190cfa970a7509e4d21f5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2458389, "upload_time": "2019-05-28T04:32:25", "url": "https://files.pythonhosted.org/packages/85/d4/8c08f8a9e801cb1b04ae67cb3cdf88b8caed52ffa16f0e2a4c86ad4d897c/sanic-restplus-0.3.3.tar.gz" } ], "0.3.4": [ { "comment_text": "", "digests": { "md5": "5bff0456130dd5a784c374abd271c4f5", "sha256": "a573284c0d297230cbb70a08fbfe95ef2ad31b97682dcb550e203d9b21ba1fc2" }, "downloads": -1, "filename": "sanic_restplus-0.3.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5bff0456130dd5a784c374abd271c4f5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 2488641, "upload_time": "2019-06-25T04:27:42", "url": "https://files.pythonhosted.org/packages/83/cf/eace9e757a92989ee052d4b2cef592634534cd365cda2db9c341a14cdebb/sanic_restplus-0.3.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6f55fbb2423aaf294d58a720c49e340b", "sha256": "1ac9da96880b7e60b77b72aa4e99bd40ea55f584b3fb5be962975acf50a5006f" }, "downloads": -1, "filename": "sanic-restplus-0.3.4.tar.gz", "has_sig": false, "md5_digest": "6f55fbb2423aaf294d58a720c49e340b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2458748, "upload_time": "2019-06-25T04:27:46", "url": "https://files.pythonhosted.org/packages/56/48/e8918593aa832a8b3f270682c9185abe98ef3a67f1b76f3bf1377b02ffc3/sanic-restplus-0.3.4.tar.gz" } ], "0.3.5": [ { "comment_text": "", "digests": { "md5": "67bd65f2c922513fba5a7a5874edb8c5", "sha256": "46b2bc5e7cfd3863c27e72358d85857fae5ffc16c7c2b0dee83c0c37a665c65d" }, "downloads": -1, "filename": "sanic_restplus-0.3.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "67bd65f2c922513fba5a7a5874edb8c5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4369808, "upload_time": "2019-08-23T08:56:00", "url": "https://files.pythonhosted.org/packages/af/05/e6bb8acd6958e58a58fce0ebe4d3045ffe730b60d40f40cafbbf490181da/sanic_restplus-0.3.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f13327cf82f8fbf0da90fadc7d9b6471", "sha256": "703841f4e07a5d4437e8644d36485aa2f3411f3b34d593bae5cb2d0b0c60510a" }, "downloads": -1, "filename": "sanic-restplus-0.3.5.tar.gz", "has_sig": false, "md5_digest": "f13327cf82f8fbf0da90fadc7d9b6471", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4321456, "upload_time": "2019-08-23T08:56:10", "url": "https://files.pythonhosted.org/packages/63/ab/328249ab25196484bfb25a52aec70d4fa51a537c0e43c74560445c284a7b/sanic-restplus-0.3.5.tar.gz" } ], "0.3.5.post1": [ { "comment_text": "", "digests": { "md5": "d1eecd584e7253980d769dd9973486e1", "sha256": "51b9c54809408cabc149f49b71df0b75f7adc12f4b2fe32c374de655469b68ce" }, "downloads": -1, "filename": "sanic_restplus-0.3.5.post1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d1eecd584e7253980d769dd9973486e1", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4369946, "upload_time": "2019-08-26T00:54:22", "url": "https://files.pythonhosted.org/packages/12/da/651cc811cf5eeaf298af68036a23c5f5a78a5736cef769d23f861a724699/sanic_restplus-0.3.5.post1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "89c861ded37c8a6ed64a797ac3004311", "sha256": "6802872fc0691b03919b71cac4e6dcb32c2757986a6c0071d087c11f5892c77c" }, "downloads": -1, "filename": "sanic-restplus-0.3.5.post1.tar.gz", "has_sig": false, "md5_digest": "89c861ded37c8a6ed64a797ac3004311", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4321578, "upload_time": "2019-08-26T00:54:33", "url": "https://files.pythonhosted.org/packages/bb/7b/4c2153a5657a1816a0048ebd055256dbaf555ff6d8ce31fb91f38b6f53e6/sanic-restplus-0.3.5.post1.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "8fced693ba07fc57b6923aa7f215dcb9", "sha256": "7b591cc96fb8af0443398782fcd7746dbff94a36e6a2ec17307379ff4ddcbbcb" }, "downloads": -1, "filename": "sanic_restplus-0.4.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8fced693ba07fc57b6923aa7f215dcb9", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 2496907, "upload_time": "2019-09-18T05:33:17", "url": "https://files.pythonhosted.org/packages/29/1f/2ab714738d1c9c4bb3b2d8b0dc3ea9edfae4aaf3123f1521452e2a41bc49/sanic_restplus-0.4.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8cbbb203a3fd323f1a089c0a4631e976", "sha256": "39310fa1e6dcf1af448cff2e0ae90001302bb285c4dea450d0b825a83a462916" }, "downloads": -1, "filename": "sanic-restplus-0.4.0.tar.gz", "has_sig": false, "md5_digest": "8cbbb203a3fd323f1a089c0a4631e976", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2466087, "upload_time": "2019-09-18T05:33:24", "url": "https://files.pythonhosted.org/packages/4d/af/7607b679a52a2636bf98bdab1ecda784ca2dcd08e2f11a1963310b6ccfbe/sanic-restplus-0.4.0.tar.gz" } ], "0.4.0.post1": [ { "comment_text": "", "digests": { "md5": "34f4beab9878c39bbe36b69bd2e3ad10", "sha256": "b8cb9132200aa2c8aa84d950c8b7315c4d48ddcb0293a88a8a2b4979cd3c8a5f" }, "downloads": -1, "filename": "sanic_restplus-0.4.0.post1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "34f4beab9878c39bbe36b69bd2e3ad10", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 2497584, "upload_time": "2019-09-18T05:44:59", "url": "https://files.pythonhosted.org/packages/0c/0b/8df6bcf17826820e980a2ce3fe972a41d99d08b3fed41a925ab3ded53bb3/sanic_restplus-0.4.0.post1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "677253fedfa1133e8013693a2184d2db", "sha256": "6c3878208c3ae775e495c07189f2a1495ab37b7c38e891d4071d8753cdb45b6f" }, "downloads": -1, "filename": "sanic-restplus-0.4.0.post1.tar.gz", "has_sig": false, "md5_digest": "677253fedfa1133e8013693a2184d2db", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2466758, "upload_time": "2019-09-18T05:45:06", "url": "https://files.pythonhosted.org/packages/e2/25/cd3723413f264c8193323cb5eb5b5d6806be591b5b352499d8fe7a8d3803/sanic-restplus-0.4.0.post1.tar.gz" } ], "0.4.0b1": [ { "comment_text": "", "digests": { "md5": "fdf2197d14f9fd892a4300f6c17cc409", "sha256": "7fdc20cb59cff376e31ede824a6562f5e86e79a1e6b20ae09f459e7848cbca75" }, "downloads": -1, "filename": "sanic_restplus-0.4.0b1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "fdf2197d14f9fd892a4300f6c17cc409", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 2496952, "upload_time": "2019-08-26T06:26:29", "url": "https://files.pythonhosted.org/packages/c1/8d/04abb0eced9a73a1cd53b38d7d4c93ed556f8393fe28b81be935113c588b/sanic_restplus-0.4.0b1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "783aacc258ec5775581c3c2c2fa5dab8", "sha256": "e6c09c3176c8d85de46bfe98aa08efcccc104fc243eab9f30f1b9ae43a993e85" }, "downloads": -1, "filename": "sanic-restplus-0.4.0b1.tar.gz", "has_sig": false, "md5_digest": "783aacc258ec5775581c3c2c2fa5dab8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2466070, "upload_time": "2019-08-26T06:26:37", "url": "https://files.pythonhosted.org/packages/77/cf/867c5d3e1a778c276532e1cda32cb358db44d04df34ac1b1b03c8cdc79eb/sanic-restplus-0.4.0b1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "34f4beab9878c39bbe36b69bd2e3ad10", "sha256": "b8cb9132200aa2c8aa84d950c8b7315c4d48ddcb0293a88a8a2b4979cd3c8a5f" }, "downloads": -1, "filename": "sanic_restplus-0.4.0.post1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "34f4beab9878c39bbe36b69bd2e3ad10", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 2497584, "upload_time": "2019-09-18T05:44:59", "url": "https://files.pythonhosted.org/packages/0c/0b/8df6bcf17826820e980a2ce3fe972a41d99d08b3fed41a925ab3ded53bb3/sanic_restplus-0.4.0.post1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "677253fedfa1133e8013693a2184d2db", "sha256": "6c3878208c3ae775e495c07189f2a1495ab37b7c38e891d4071d8753cdb45b6f" }, "downloads": -1, "filename": "sanic-restplus-0.4.0.post1.tar.gz", "has_sig": false, "md5_digest": "677253fedfa1133e8013693a2184d2db", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2466758, "upload_time": "2019-09-18T05:45:06", "url": "https://files.pythonhosted.org/packages/e2/25/cd3723413f264c8193323cb5eb5b5d6806be591b5b352499d8fe7a8d3803/sanic-restplus-0.4.0.post1.tar.gz" } ] }