Starlette is an asynchronous web framework and toolkit for building high-performance web services based on the ASGI specification. It serves as a lightweight foundation for creating web applications with a focus on asynchronous request and response handling.
The framework provides specialized toolkits for managing persistent bidirectional WebSocket communication and an asynchronous HTTP server toolkit for routing and middleware. It distinguishes itself by offering a non-blocking background task queue that executes functions after a response has been sent to the client.
The project covers a broad range of web infrastructure capabilities, including static file distribution, form data parsing, and response body streaming. It also includes built-in support for session management, cross-origin resource sharing policies, and HTTP response compression.
A dedicated client is included to simulate HTTP requests for testing web endpoints without requiring a live server.