All Projects → python-restx → Flask Restx

python-restx / Flask Restx

Licence: other
Fork of Flask-RESTPlus: Fully featured framework for fast, easy and documented API development with Flask

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Flask Restx

Flask Restplus
Fully featured framework for fast, easy and documented API development with Flask
Stars: ✭ 2,585 (+146.19%)
Mutual labels:  api, rest, swagger, restful, json, flask
Flama
🔥 Fire up your API with this flamethrower
Stars: ✭ 161 (-84.67%)
Mutual labels:  api, rest, swagger, restful
Flasgger
Easy OpenAPI specs and Swagger UI for your Flask API
Stars: ✭ 2,825 (+169.05%)
Mutual labels:  api, swagger, restful, flask
Api Client Generator
Angular REST API client generator from Swagger YAML or JSON file with camel case settigs
Stars: ✭ 92 (-91.24%)
Mutual labels:  api, rest, swagger, json
Koa Rest Api Boilerplate
💯 Boilerplate for Node.js Koa RESTful API application with Docker, Swagger, Jest, CodeCov and CircleCI
Stars: ✭ 420 (-60%)
Mutual labels:  api, rest, swagger, restful
Generator Http Fake Backend
Yeoman generator for building a fake backend by providing the content of JSON files or JavaScript objects through configurable routes.
Stars: ✭ 49 (-95.33%)
Mutual labels:  api, rest, restful, json
Http Fake Backend
Build a fake backend by providing the content of JSON files or JavaScript objects through configurable routes.
Stars: ✭ 253 (-75.9%)
Mutual labels:  api, rest, restful, json
Fastapi
FastAPI framework, high performance, easy to learn, fast to code, ready for production
Stars: ✭ 39,588 (+3670.29%)
Mutual labels:  api, rest, swagger, json
Networking
⚡️ Elegantly connect to a REST JSON Api. URLSession + Combine + Decodable + Generics = <3
Stars: ✭ 499 (-52.48%)
Mutual labels:  api, rest, json
Jikan
Unofficial MyAnimeList PHP+REST API which provides functions other than the official API
Stars: ✭ 531 (-49.43%)
Mutual labels:  api, rest, json
Spyke
Interact with REST services in an ActiveRecord-like manner
Stars: ✭ 591 (-43.71%)
Mutual labels:  api, rest, json
Zerocode
A community-developed, free, open source, microservices API automation and load testing framework built using JUnit core runners for Http REST, SOAP, Security, Database, Kafka and much more. Zerocode Open Source enables you to create, change, orchestrate and maintain your automated test cases declaratively with absolute ease.
Stars: ✭ 482 (-54.1%)
Mutual labels:  api, rest, json
Typescript Rest
This is a lightweight annotation-based expressjs extension for typescript.
Stars: ✭ 458 (-56.38%)
Mutual labels:  api, rest, restful
Swagger Stats
API Observability. Trace API calls and Monitor API performance, health and usage statistics in Node.js Microservices.
Stars: ✭ 559 (-46.76%)
Mutual labels:  api, rest, swagger
Full Stack
Full stack, modern web application generator. Using Flask, PostgreSQL DB, Docker, Swagger, automatic HTTPS and more.
Stars: ✭ 451 (-57.05%)
Mutual labels:  api, swagger, flask
Apidoc
RESTful API 文档生成工具,支持 Go、Java、Swift、JavaScript、Rust、PHP、Python、Typescript、Kotlin 和 Ruby 等大部分语言。
Stars: ✭ 785 (-25.24%)
Mutual labels:  api, rest, restful
Ngx Restangular
Restangular for Angular 2 and higher versions
Stars: ✭ 787 (-25.05%)
Mutual labels:  api, rest, restful
Goa
Design-based APIs and microservices in Go
Stars: ✭ 4,493 (+327.9%)
Mutual labels:  api, rest, swagger
Snake
🐍 一款小巧的基于Go构建的开发框架,可以快速构建API服务或者Web网站进行业务开发,遵循SOLID设计原则
Stars: ✭ 615 (-41.43%)
Mutual labels:  api, swagger, restful
Apispec
A pluggable API specification generator. Currently supports the OpenAPI Specification (f.k.a. the Swagger specification)..
Stars: ✭ 831 (-20.86%)
Mutual labels:  api, swagger, flask

=========== Flask RESTX

.. image:: https://github.com/python-restx/flask-restx/workflows/Tests/badge.svg?branch=master&event=push :target: https://github.com/python-restx/flask-restx/actions?query=workflow%3ATests :alt: Tests status .. image:: https://codecov.io/gh/python-restx/flask-restx/branch/master/graph/badge.svg :target: https://codecov.io/gh/python-restx/flask-restx :alt: Code coverage .. image:: https://readthedocs.org/projects/flask-restx/badge/?version=latest :target: https://flask-restx.readthedocs.io/en/latest/ :alt: Documentation status .. image:: https://img.shields.io/pypi/l/flask-restx.svg :target: https://pypi.org/project/flask-restx :alt: License .. image:: https://img.shields.io/pypi/pyversions/flask-restx.svg :target: https://pypi.org/project/flask-restx :alt: Supported Python versions .. image:: https://badges.gitter.im/Join%20Chat.svg :target: https://gitter.im/python-restx?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge :alt: Join the chat at https://gitter.im/python-restx .. image:: https://img.shields.io/badge/code%20style-black-000000.svg :target: https://github.com/psf/black :alt: Code style: black

Flask-RESTX is a community driven fork of Flask-RESTPlus <https://github.com/noirbizarre/flask-restplus>_.

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_.

Compatibility

Flask-RESTX requires Python 2.7 or 3.4+.

Installation

You can install Flask-RESTX with pip:

.. code-block:: console

$ pip install flask-restx

or with easy_install:

.. code-block:: console

$ easy_install flask-restx

Quick start

With Flask-RESTX, you only import the api instance to route and document your endpoints.

.. code-block:: python

from flask import Flask
from flask_restx import Api, Resource, fields

app = Flask(__name__)
api = Api(app, version='1.0', title='TodoMVC API',
    description='A simple TodoMVC API',
)

ns = api.namespace('todos', description='TODO operations')

todo = api.model('Todo', {
    'id': fields.Integer(readonly=True, description='The task unique identifier'),
    'task': fields.String(required=True, description='The task details')
})


class TodoDAO(object):
    def __init__(self):
        self.counter = 0
        self.todos = []

    def get(self, id):
        for todo in self.todos:
            if todo['id'] == id:
                return todo
        api.abort(404, "Todo {} doesn't exist".format(id))

    def create(self, data):
        todo = data
        todo['id'] = self.counter = self.counter + 1
        self.todos.append(todo)
        return todo

    def update(self, id, data):
        todo = self.get(id)
        todo.update(data)
        return todo

    def delete(self, id):
        todo = self.get(id)
        self.todos.remove(todo)


DAO = TodoDAO()
DAO.create({'task': 'Build an API'})
DAO.create({'task': '?????'})
DAO.create({'task': 'profit!'})


@ns.route('/')
class TodoList(Resource):
    '''Shows a list of all todos, and lets you POST to add new tasks'''
    @ns.doc('list_todos')
    @ns.marshal_list_with(todo)
    def get(self):
        '''List all tasks'''
        return DAO.todos

    @ns.doc('create_todo')
    @ns.expect(todo)
    @ns.marshal_with(todo, code=201)
    def post(self):
        '''Create a new task'''
        return DAO.create(api.payload), 201


@ns.route('/<int:id>')
@ns.response(404, 'Todo not found')
@ns.param('id', 'The task identifier')
class Todo(Resource):
    '''Show a single todo item and lets you delete them'''
    @ns.doc('get_todo')
    @ns.marshal_with(todo)
    def get(self, id):
        '''Fetch a given resource'''
        return DAO.get(id)

    @ns.doc('delete_todo')
    @ns.response(204, 'Todo deleted')
    def delete(self, id):
        '''Delete a task given its identifier'''
        DAO.delete(id)
        return '', 204

    @ns.expect(todo)
    @ns.marshal_with(todo)
    def put(self, id):
        '''Update a task given its identifier'''
        return DAO.update(id, api.payload)


if __name__ == '__main__':
    app.run(debug=True)

Contributors

Flask-RESTX is brought to you by @python-restx. Since early 2019 @SteadBytes, @a-luna, @j5awry, @ziirish volunteered to help @python-restx keep the project up and running. Of course everyone is welcome to contribute and we will be happy to review your PR's or answer to your issues.

Documentation

The documentation is hosted on Read the Docs <http://flask-restx.readthedocs.io/en/latest/>_

.. _Flask: http://flask.pocoo.org/ .. _Swagger: http://swagger.io/

Contribution

Want to contribute! That's awesome! Check out CONTRIBUTING.rst! <https://github.com/python-restx/flask-restx/blob/master/CONTRIBUTING.rst>_

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].