Created by: tiangolo
What is this project?
FastAPI is a modern, fast (high-performance), web framework for building APIs with Python 3.6+.
Documentation: https://fastapi.tiangolo.com
Source Code: https://github.com/tiangolo/fastapi
The key features are:
-
Fast: Very high performance, on par with NodeJS and Go (thanks to Starlette and Pydantic).
-
Fast to code: Increase the speed to develop features by about 200% to 300% *.
-
Less bugs: Reduce about 40% of human (developer) induced errors. *
-
Intuitive: Great editor support. Completion everywhere. Less time debugging.
-
Easy: Designed to be easy to use and learn. Less time reading docs.
-
Short: Minimize code duplication. Multiple features from each parameter declaration. Less bugs.
-
Robust: Get production-ready code. With automatic interactive documentation.
-
Standards-based: Based on (and fully compatible with) the open standards for APIs: OpenAPI and JSON Schema.
* estimation based on tests on an internal development team, building production applications.
Why is it awesome?
Apart from the features above, the fact that with simple, standard Python 3.6+ type declarations, you get:
- Great editor support (completion everywhere and type checks).
- Data conversion (serialization, parsing).
- Data validation.
- Automatic annotations and documentation using OpenAPI and JSON Schema.
- 2 automatic interactive API documentation user interfaces.
A block of code is worth a thousand words:
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
def read_root():
return {"Hello": "World"}
@app.get("/items/{item_id}")
def read_item(item_id: int, q: str = None):
return {"item_id": item_id, "q": q}
And you get this, "for free":
And the coding experience is great, with completion and type checks everywhere:
--
Anyone who agrees with this pull request could vote for it by adding a