Starlette is a lightweight ASGI framework/toolkit, which is ideal for building async web services in Python.
Python 3.7+
pip install starlette
You'll also want to install an ASGI server, such as uvicorn, daphne, or hypercorn.
pip install uvicorn
uvicorn example:app
Starlette only requires anyio
, and the following dependencies are optional:
httpx
- Required if you want to use theTestClient
.jinja2
- Required if you want to useJinja2Templates
.python-multipart
- Required if you want to support form parsing, withrequest.form()
.itsdangerous
- Required forSessionMiddleware
support.pyyaml
- Required forSchemaGenerator
support.
You can install all of these with pip3 install starlette[full]
.