# encode/starlette

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/encode-starlette).**

12,397 stars · 1,202 forks · Python · BSD-3-Clause

## Links

- GitHub: https://github.com/encode/starlette
- Homepage: https://starlette.dev
- awesome-repositories: https://awesome-repositories.com/repository/encode-starlette.md

## Description

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.

## Tags

### Web Development

- [ASGI Frameworks](https://awesome-repositories.com/f/web-development/web-server-frameworks/asgi-frameworks.md) — Implements the ASGI specification to enable high-performance, non-blocking asynchronous web service development. ([source](https://github.com/encode/starlette#readme))
- [Asynchronous Server Toolkits](https://awesome-repositories.com/f/web-development/asynchronous-server-toolkits.md) — Provides a comprehensive toolkit for handling asynchronous HTTP request and response cycles, including routing and middleware.
- [Asynchronous Web Frameworks](https://awesome-repositories.com/f/web-development/asynchronous-web-frameworks.md) — Provides a high-performance server foundation built on non-blocking execution for concurrent request processing.
- [Lightweight Web Frameworks](https://awesome-repositories.com/f/web-development/lightweight-web-frameworks.md) — Provides a minimalist asynchronous foundation for building web services with built-in session and static file support.
- [Real-Time Communication](https://awesome-repositories.com/f/web-development/real-time-communication.md) — Enables real-time, bidirectional data streaming between clients and servers using WebSockets.
- [Asynchronous Route Mapping](https://awesome-repositories.com/f/web-development/server-side-frameworks/kotlin-frameworks/coroutine-frameworks/asynchronous-route-mapping.md) — Provides a routing system that maps incoming HTTP paths to asynchronous coroutines.
- [Response Streaming](https://awesome-repositories.com/f/web-development/backend-development/request-response-handling/http-response-handling/response-streaming.md) — Supports incremental delivery of large HTTP response bodies using asynchronous generators to reduce memory overhead.
- [Multipart Form Parsing](https://awesome-repositories.com/f/web-development/multipart-upload-utilities/multipart-form-parsing.md) — Provides capabilities for extracting key-value pairs and files from multipart and URL-encoded form submissions. ([source](https://github.com/encode/starlette#readme))
- [Static File Servers](https://awesome-repositories.com/f/web-development/web-infrastructure-deployment/web-server-capabilities/static-file-servers.md) — Delivers static assets like images and stylesheets from the local filesystem to web clients. ([source](https://github.com/encode/starlette#readme))

### Part of an Awesome List

- [Post-Response Task Queues](https://awesome-repositories.com/f/awesome-lists/devops/task-queues-and-background-jobs/post-response-task-queues.md) — Ships a non-blocking background task queue that executes functions after the response is sent.
- [Web Frameworks](https://awesome-repositories.com/f/awesome-lists/devtools/web-frameworks.md) — Lightweight ASGI framework.

### Networking & Communication

- [Middleware-Based Request Pipelines](https://awesome-repositories.com/f/networking-communication/communication-protocols-architectures/request-processing-architectures/request-processing/middleware-based-request-pipelines.md) — Implements a modular pipeline of pluggable middleware to intercept and process requests and responses.
- [WebSocket Servers](https://awesome-repositories.com/f/networking-communication/distributed-systems-p2p/distributed-computing/communication-protocols/websocket-implementations/websocket-servers.md) — Implements server-side management of persistent, bidirectional WebSocket channels for real-time data exchange. ([source](https://github.com/encode/starlette#readme))
- [Response Streaming](https://awesome-repositories.com/f/networking-communication/api-integration-frameworks/http-client-libraries/http-client-utilities/response-streaming.md) — Enables sending response bodies to clients as continuous data streams to optimize memory usage. ([source](https://github.com/encode/starlette#readme))
- [WebSocket Implementations](https://awesome-repositories.com/f/networking-communication/websocket-implementations.md) — Provides a specialized toolkit for implementing persistent bidirectional WebSocket communication channels.

### Programming Languages & Runtimes

- [Asynchronous Event Loops](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/concurrency-models/asynchronous-event-loops.md) — Leverages a non-blocking event-driven execution model to handle concurrent connections efficiently.

### Software Engineering & Architecture

- [Asynchronous Task Processing](https://awesome-repositories.com/f/software-engineering-architecture/asynchronous-task-processing.md) — Offloads non-critical operations to background processes to keep web requests fast and responsive.
- [High-Performance API Frameworks](https://awesome-repositories.com/f/software-engineering-architecture/high-performance-api-frameworks.md) — Offers a lightweight framework optimized for low-latency API communication, efficient data parsing, and response compression.

### DevOps & Infrastructure

- [Background Task Runners](https://awesome-repositories.com/f/devops-infrastructure/automation-orchestration/task-execution-frameworks/task-job-management/background-task-runners.md) — Executes non-blocking background tasks within the same process after a client response is delivered. ([source](https://github.com/encode/starlette#readme))

### Testing & Quality Assurance

- [Simulated Request Testing](https://awesome-repositories.com/f/testing-quality-assurance/api-endpoint-testing/simulated-request-testing.md) — Includes a dedicated client to simulate HTTP requests for verifying endpoints without a live server. ([source](https://github.com/encode/starlette#readme))
