fastapi

  • a minimalist and fast backend framework based on starlette and pydantic
  • should be used to build highly performant apis for production use

creating an api

  1. install fastapi
pip install fastapi
  1. create a simple hello world api
from fastapi import FastAPI
app = FastAPI()
 
# GET request  
@app.get("/")
def index():
return {"message": "Hello, World!!"}
  1. run the app on local
fastapi run dev

python fastapi vs django vs flask

202508202229