Flask-RESTX is an extension for Flask that adds support for quickly building REST APIs in Python. Flask-RESTX is a community-driven fork of Flask-RESTPlus, hence users can also make use of [flask-restplus] tag in addition to [flask-restx] to search for relevant issues and questions.
Flask-RESTX is an extension for Flask that adds support for quickly building REST APIs.
Flask-RESTX encourages best practices with minimal setup. If you are familiar with Flask, Flask-RESTX should be easy to pick up.
It provides a coherent collection of decorators and tools to describe your API and expose its documentation properly using Swagger.
Flask-RESTX is a community driven fork of Flask-RESTPlus
A Minimal API
A minimal Flask-RESTX API looks like this:
from flask import Flask
from flask_restx import Resource, Api
app = Flask(__name__)
api = Api(app)
@api.route('/hello')
class HelloWorld(Resource):
def get(self):
return {'hello': 'world'}
if __name__ == '__main__':
app.run(debug=True)
Compatibility
Flask-RESTX requires Python 2.7 or 3.4+.
Documentation
The documentation is hosted on Read the Docs