On this page
Overview
Starlette is a lightweight ASGI framework and toolkit for Python. It provides routing, WebSockets, background tasks, lifecycle handling, CORS, GZip, static files, streaming responses, sessions, and related primitives for composing asynchronous web services.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Compose HTTP, WebSocket, and middleware behavior at the component level
Routing, HTTP responses, WebSockets, background tasks, CORS, GZip, static files, streaming responses, and sessions can be used as separate components. Starlette can act as a complete framework or as an ASGI toolkit from which applications select only the pieces they need.
Sources: [2]
Keep required dependencies small and add optional capabilities deliberately
Starlette 1.7.0 centers its required dependency set on AnyIO 4. TestClient, Jinja2 templates, OpenTelemetry, multipart form parsing, sessions, and schema generation use optional dependencies selected by the application.
Best fit
Fits asynchronous backends that want explicit ASGI building blocks
It is useful when a service prefers explicit HTTP, WebSocket, and middleware boundaries over a larger full-stack architecture, or when reusable ASGI components need to be shared across applications.
Sources: [2]
Before adoption
Require Python 3.10+ and AnyIO 4, and treat OpenTelemetry middleware as experimental
Starlette 1.7.0 requires Python 3.10 or newer and AnyIO 4. Its OpenTelemetryMiddleware is explicitly experimental, and the release notes warn that its API and emitted telemetry may change in minor releases without a deprecation period.
Official sources
- [1]Kludex/starlette — GitHub repository(2026-10-06)
- [2]Starlette 1.7.0 — README(2026-10-06)
- [3]Starlette 1.7.0 — pyproject.toml(2026-10-06)
- [4]Starlette 1.7.0 release(2026-10-06)
- [5]Starlette BSD-3-Clause license(2026-10-06)
Supplemental curator note
Starlette fits teams that want HTTP, WebSocket, and middleware primitives at ASGI granularity rather than a full-stack bundle. Its small dependency surface leaves database, authentication, and other surrounding architecture as explicit application choices.
Try it in 3 steps
- 1
Install Starlette 1.7.0 and Uvicorn
Pin the reviewed Starlette release and the ASGI server recommended by its README. Python 3.10 or newer is required.
python -m pip install "starlette==1.7.0" "uvicorn==0.54.0" - 2
Create a minimal Starlette application
Save a minimal version of the routing example from the official README as main.py.
cat > main.py <<'PY' from starlette.applications import Starlette from starlette.responses import JSONResponse from starlette.routing import Route async def homepage(request): return JSONResponse({'hello': 'world'}) app = Starlette(routes=[Route('/', homepage)]) PY - 3
Start the application with an ASGI server
Start Uvicorn, then open http://127.0.0.1:8000/ from another terminal or browser and confirm the JSON response.
uvicorn main:app
Growth
Growth trends · Last 30 days
12,655 Stars
Trend data is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- asgi
- async
- http
- python
- websockets
- Stars
- 12,655
- Forks
- 1,361
- Watchers
- 100
- Open issues
- 58
- Contributors
- 340
- Owner type
- User
- Primary language
- Python
- License
- BSD-3-Clause
- Repository last updated
- Oct 5, 2026
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- HTTPX15,526 Stars
3 shared tag(s) · 1 shared category(s) · Same language
use synchronous and asynchronous HTTP APIs with HTTP/2 in one Python client
Python - Express69,541 Stars
3 shared tag(s) · 1 shared category(s)
Build Node.js APIs and web backends by composing routing and middleware into a thin HTTP layer
JavaScript - aiohttp16,569 Stars
4 shared tag(s) · 2 shared category(s) · Same language
build asyncio HTTP clients, servers, and WebSockets with one Python framework
Python - Flask74,897 Stars
4 shared tag(s) · 1 shared category(s) · Same language
build Python WSGI applications with routing, request handling, and Jinja templates
Python - FastAPI102,814 Stars
3 shared tag(s) · 2 shared category(s) · Same language
Unify validation, dependency injection, and OpenAPI around Python type declarations
Python - Django REST framework30,201 Stars
3 shared tag(s) · 2 shared category(s) · Same language
build Django Web APIs with serializers, authentication, permissions, and viewsets
Python
Report incorrect information
Tell us if any listing information is incorrect or outdated.