Frameworks78k+ stars
FastAPI
Modern, fast web framework for building APIs with Python
Commit Details
- Message
- "Initial commit"
- Author
- Sebastián Ramírez
- Date
- 2018-12-05
- Hash
- 5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a
Fun Fact
FastAPI is one of the fastest Python frameworks available. It uses Python type hints for automatic validation and documentation.
</>First Code
Python
"""
FastAPI - Modern Python web framework
High performance, easy to learn, fast to code
"""
from typing import Optional
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: Optional[str] = None):
return {"item_id": item_id, "q": q}
# The magic: automatic OpenAPI docs, type hints, async support← All Projects
24 of 48