{ "info": { "author": "Joshua Carp", "author_email": "jm.carp@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "=============\nflask-apispec\n=============\n\n.. image:: https://img.shields.io/pypi/v/flask-apispec.svg\n :target: http://badge.fury.io/py/flask-apispec\n :alt: Latest version\n\n.. image:: https://readthedocs.org/projects/flask-apispec/badge/?version=latest\n :target: https://flask-apispec.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation status\n\n.. image:: https://img.shields.io/travis/jmcarp/flask-apispec/master.svg\n :target: https://travis-ci.org/jmcarp/flask-apispec\n :alt: Travis-CI\n\n.. image:: https://img.shields.io/codecov/c/github/jmcarp/flask-apispec/master.svg\n :target: https://codecov.io/github/jmcarp/flask-apispec\n :alt: Code coverage\n\n**flask-apispec** is a lightweight tool for building REST APIs in Flask. **flask-apispec** uses webargs_ for request parsing, marshmallow_ for response formatting, and apispec_ to automatically generate Swagger markup. You can use **flask-apispec** with vanilla Flask or a fuller-featured framework like Flask-RESTful_.\n\nInstall\n-------\n\n::\n\n pip install flask-apispec\n\nQuickstart\n----------\n\n.. code-block:: python\n\n from flask import Flask\n from flask_apispec import use_kwargs, marshal_with\n\n from marshmallow import fields, Schema\n\n from .models import Pet\n\n app = Flask(__name__)\n\n class PetSchema(Schema):\n class Meta:\n fields = ('name', 'category', 'size')\n\n @app.route('/pets')\n @use_kwargs({'category': fields.Str(), 'size': fields.Str()})\n @marshal_with(PetSchema(many=True))\n def get_pets(**kwargs):\n return Pet.query.filter_by(**kwargs)\n\n**flask-apispec** works with function- and class-based views:\n\n.. code-block:: python\n\n from flask import make_response\n from flask_apispec.views import MethodResource\n\n class PetResource(MethodResource):\n\n @marshal_with(PetSchema)\n def get(self, pet_id):\n return Pet.query.filter(Pet.id == pet_id).one()\n\n @use_kwargs(PetSchema)\n @marshal_with(PetSchema, code=201)\n def post(self, **kwargs):\n return Pet(**kwargs)\n\n @use_kwargs(PetSchema)\n @marshal_with(PetSchema)\n def put(self, pet_id, **kwargs):\n pet = Pet.query.filter(Pet.id == pet_id).one()\n pet.__dict__.update(**kwargs)\n return pet\n\n @marshal_with(None, code=204)\n def delete(self, pet_id):\n pet = Pet.query.filter(Pet.id == pet_id).one()\n pet.delete()\n return make_response('', 204)\n\n**flask-apispec** generates Swagger markup for your view functions and classes. By default, Swagger JSON is served at `/swagger/`, and Swagger-UI at `/swagger-ui/`.\n\n.. code-block:: python\n\n from apispec import APISpec\n from flask_apispec.extension import FlaskApiSpec\n\n app.config.update({\n 'APISPEC_SPEC': APISpec(\n title='pets',\n version='v1',\n plugins=['apispec.ext.marshmallow'],\n ),\n 'APISPEC_SWAGGER_URL': '/swagger/',\n })\n docs = FlaskApiSpec(app)\n\n docs.register(get_pets)\n docs.register(PetResource)\n\nDocumentation\n-------------\n\nhttps://flask-apispec.readthedocs.io/\n\nNotes\n-----\n\n**flask-apispec** is strongly inspired by Flask-RESTful_ and Flask-RESTplus_, but attempts to provide similar functionality with greater flexibility and less code.\n\n.. _webargs: https://webargs.readthedocs.io/\n.. _marshmallow: https://marshmallow.readthedocs.io/\n.. _apispec: https://apispec.readthedocs.io/\n.. _Flask-RESTful: https://flask-restful.readthedocs.io/\n.. _Flask-RESTplus: https://flask-restplus.readthedocs.io/\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jmcarp/flask-apispec", "keywords": "flask marshmallow webargs apispec", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "flask-apispec-rovanion", "package_url": "https://pypi.org/project/flask-apispec-rovanion/", "platform": "", "project_url": "https://pypi.org/project/flask-apispec-rovanion/", "project_urls": { "Homepage": "https://github.com/jmcarp/flask-apispec" }, "release_url": "https://pypi.org/project/flask-apispec-rovanion/0.6.1/", "requires_dist": null, "requires_python": "", "summary": "Build and document REST APIs with Flask and apispec", "version": "0.6.1" }, "last_serial": 3976534, "releases": { "0.6.0.post0": [ { "comment_text": "", "digests": { "md5": "05d9b4a552dcdbd14e9764bdc7f5f5fe", "sha256": "e50dbdf9bfb016d0cb0f57dfa266473640304cec82cfdfb4dc664d5033824d73" }, "downloads": -1, "filename": "flask-apispec-rovanion-0.6.0.post0.tar.gz", "has_sig": false, "md5_digest": "05d9b4a552dcdbd14e9764bdc7f5f5fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1010784, "upload_time": "2018-06-19T08:42:13", "url": "https://files.pythonhosted.org/packages/34/1d/cfb2c72445b73e200ed7717dc3d2577e4d62f6b33e2e66aaca30403eaa52/flask-apispec-rovanion-0.6.0.post0.tar.gz" } ], "0.6.1": [ { "comment_text": "", "digests": { "md5": "50eb1d8345c5e71a9d20794bb082f754", "sha256": "dba2a6d15dabdfdc19591e79ed2abd46bb7384e5aaf1ea37e379edaeb2989ad6" }, "downloads": -1, "filename": "flask-apispec-rovanion-0.6.1.tar.gz", "has_sig": false, "md5_digest": "50eb1d8345c5e71a9d20794bb082f754", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1010749, "upload_time": "2018-06-19T08:43:27", "url": "https://files.pythonhosted.org/packages/45/09/964de61e5eeae188951192b08d448615636048fd4784109b4647e6d832fc/flask-apispec-rovanion-0.6.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "50eb1d8345c5e71a9d20794bb082f754", "sha256": "dba2a6d15dabdfdc19591e79ed2abd46bb7384e5aaf1ea37e379edaeb2989ad6" }, "downloads": -1, "filename": "flask-apispec-rovanion-0.6.1.tar.gz", "has_sig": false, "md5_digest": "50eb1d8345c5e71a9d20794bb082f754", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1010749, "upload_time": "2018-06-19T08:43:27", "url": "https://files.pythonhosted.org/packages/45/09/964de61e5eeae188951192b08d448615636048fd4784109b4647e6d832fc/flask-apispec-rovanion-0.6.1.tar.gz" } ] }