Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up FastAPI #286

Closed
MaybeJustJames opened this issue Mar 25, 2020 · 4 comments · Fixed by #309
Closed

Set up FastAPI #286

MaybeJustJames opened this issue Mar 25, 2020 · 4 comments · Fixed by #309
Assignees
Labels

Comments

@MaybeJustJames
Copy link
Collaborator

MaybeJustJames commented Mar 25, 2020

  1. Install and configure the above packages.
  2. Re-structure the server app to use FastAPI for web requests.
@MaybeJustJames MaybeJustJames changed the title Set up Flask, Flask-RESTful, Flask-SQLAlchemy, flask-marshmellow Set up Flask, Flask-RESTful, Flask-SQLAlchemy, flask-marshmellow Mar 25, 2020
@MaybeJustJames MaybeJustJames self-assigned this Apr 6, 2020
@MaybeJustJames
Copy link
Collaborator Author

MaybeJustJames commented May 7, 2020

Evaluation of other framework options:

  1. Flask + flask-smorest + Marshmallow + Gunicorn
    Stability: Flask (pypi 1.1.2; github 50k stars), flask-smorest (pypi 0.21.0; github 226 stars), Marshmallow (pypi 3.5.2; github 4.6k stars), Gunicorn (pypi 20.0.4; github 6.8k stars)
    Streaming: HTTP/1 chunked encoding requires support from mod_wsgi and Apache
    OpenAPI: Autogenerated by flask-smorest
    Documentation: Excellent. Includes useful example code. +Stack overflow
    Deployment: Gunicorn --> Flask/SCope

@MaybeJustJames
Copy link
Collaborator Author

MaybeJustJames commented May 7, 2020

  1. Quart + Hypercorn + quart-openapi + Databases
    Note: Using Marshmallow is not really mentioned. Very close to the Flask API
    Stability: Quart (pypi 0.11.5; gitlab 682 stars), Hypercorn (pypi 0.9.5; gitlab 151 stars), quart-openapi (pypi 1.5.3; github 57 stars), Databases (pypi 0.3.2; github 1.2k stars)
    Streaming: Yes (https://pgjones.gitlab.io/quart/how_to_guides/streaming_response.html) and server sent events
    OpenAPI: Yes though quart-openapi
    Documentation: Excellent. Includes useful example code. +Stack overflow
    Deployment: Hypercorn --> Quart

@MaybeJustJames
Copy link
Collaborator Author

MaybeJustJames commented May 7, 2020

  1. Sanic + sanic-restplus + Databases
    Note: sanic-restplus (based on flask-restplus) has no docs for Marshmallow or pydantic integration.
    Stability: Sanic (pypi 19.12.2; github 13.7k stars), sanic-restplus (pypi 0.5.3; github 89 stars), Databases (pypi 0.3.2; github 1.2k stars)
    Streaming: Both request and response
    OpenAPI: Yes through sanic-restplus
    Documentation: Very good. Includes useful example code. +Stackoverflow +Awesome Sanic
    Deployment: Sanic

@MaybeJustJames
Copy link
Collaborator Author

MaybeJustJames commented May 7, 2020

  1. FastAPI + Hypercorn + Databases
    Notes: Explicitly for APIs. No mention of Marshmallow. Validation with Pydantic built in. Example for msgpack response and consideration flatbuffer response when propper HTTP Accept header is provided.
    Stability: FastAPI (pypi 0.54.1; github 13.4k stars), Hypercorn (pypi 0.9.5; gitlab 151 stars), Databases (pypi 0.3.2; github 1.2k stars)
    Streaming: https://www.starlette.io/responses/#streamingresponse
    OpenAPI: Built-in auto-generation + JSON Schema (https://fastapi.tiangolo.com/features/#automatic-docs)
    Documentation: Excellent. Includes useful example code. +Stackoverflow
    Deployment: Hypercorn --> FastAPI

@MaybeJustJames MaybeJustJames changed the title Set up Flask, Flask-RESTful, Flask-SQLAlchemy, flask-marshmellow Set up FastAPI May 12, 2020
MaybeJustJames added a commit that referenced this issue May 27, 2020
Add FastAPI HTTP interface

Closes #286
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant