This is a lightweight asynchronous REST API built with FastAPI and Python’s native async/await features. It demonstrates non-blocking request handling and structured API documentation using Pydantic and OpenAPI.
-
Asynchronous API using
async def+await -
POST endpoint:
/process— transforms input with artificial delay -
Request validation with Pydantic
-
Auto-generated interactive docs:
/docs(Swagger UI),/redoc -
Powered by Uvicorn ASGI server
pip install -r requirements.txt
pip install fastapi uvicorn
uvicorn main:app --reload
Then open your browser:
-
Swagger UI: http://127.0.0.1:8000/docs
-
ReDoc: http://127.0.0.1:8000/redoc
POST /process
{
"text": "hello fastapi"
}
{
"input": "hello fastapi",
"result": "HELLO FASTAPI"
}
.
├── main.py # FastAPI app with /process endpoint
├── requirements.txt # Dependencies
├── README.md # You're here
└── .gitignore # Ignore __pycache__, venv, etc.
-
Languages: Python
-
Frameworks: FastAPI, Pydantic
-
Async Programming:
async/await -
API Docs: Swagger UI, ReDoc (via OpenAPI)
-
Web Server: Uvicorn
-
Tools: Git, cURL, VS Code, Jupyter Notebook
MIT License © 2025
Last Updated: September 2025