freshcrate
Skin:/
Home > Frameworks > starlette

starlette

The little ASGI library that shines.

Why this rank:Release freshnessHealthy release cadence

Description

<p align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/Kludex/starlette/main/docs/img/starlette_dark.svg" width="420px"> <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/Kludex/starlette/main/docs/img/starlette.svg" width="420px"> <img alt="starlette-logo" src="https://raw.githubusercontent.com/Kludex/starlette/main/docs/img/starlette.svg"> </picture> </p> <p align="center"> <em>✨ The little ASGI framework that shines. ✨</em> </p> --- [![Build Status](https://github.com/Kludex/starlette/workflows/Test%20Suite/badge.svg)](https://github.com/Kludex/starlette/actions) [![Package version](https://badge.fury.io/py/starlette.svg)](https://pypi.python.org/pypi/starlette) [![Supported Python Version](https://img.shields.io/pypi/pyversions/starlette.svg?color=%2334D058)](https://pypi.org/project/starlette) [![Discord](https://img.shields.io/discord/1051468649518616576?logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/RxKUF5JuHs) --- **Documentation**: <a href="https://starlette.dev/" target="_blank">https://starlette.dev</a> **Source Code**: <a href="https://github.com/Kludex/starlette" target="_blank">https://github.com/Kludex/starlette</a> --- # Starlette Starlette is a lightweight [ASGI][asgi] framework/toolkit, which is ideal for building async web services in Python. It is production-ready, and gives you the following: * A lightweight, low-complexity HTTP web framework. * WebSocket support. * In-process background tasks. * Startup and shutdown events. * Test client built on `httpx`. * CORS, GZip, Static Files, Streaming responses. * Session and Cookie support. * 100% test coverage. * 100% type annotated codebase. * Few hard dependencies. * Compatible with `asyncio` and `trio` backends. * Great overall performance [against independent benchmarks][techempower]. ## Installation ```shell $ pip install starlette ``` You'll also want to install an ASGI server, such as [uvicorn](https://www.uvicorn.org/), [daphne](https://github.com/django/daphne/), or [hypercorn](https://hypercorn.readthedocs.io/en/latest/). ```shell $ pip install uvicorn ``` ## Example ```python title="main.py" from starlette.applications import Starlette from starlette.responses import JSONResponse from starlette.routing import Route async def homepage(request): return JSONResponse({'hello': 'world'}) routes = [ Route("/", endpoint=homepage) ] app = Starlette(debug=True, routes=routes) ``` Then run the application using Uvicorn: ```shell $ uvicorn main:app ``` ## Dependencies Starlette only requires `anyio`, and the following are optional: * [`httpx`][httpx] - Required if you want to use the `TestClient`. * [`jinja2`][jinja2] - Required if you want to use `Jinja2Templates`. * [`python-multipart`][python-multipart] - Required if you want to support form parsing, with `request.form()`. * [`itsdangerous`][itsdangerous] - Required for `SessionMiddleware` support. * [`pyyaml`][pyyaml] - Required for `SchemaGenerator` support. You can install all of these with `pip install starlette[full]`. ## Framework or Toolkit Starlette is designed to be used either as a complete framework, or as an ASGI toolkit. You can use any of its components independently. ```python from starlette.responses import PlainTextResponse async def app(scope, receive, send): assert scope['type'] == 'http' response = PlainTextResponse('Hello, world!') await response(scope, receive, send) ``` Run the `app` application in `example.py`: ```shell $ uvicorn example:app INFO: Started server process [11509] INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit) ``` Run uvicorn with `--reload` to enable auto-reloading on code changes. ## Modularity The modularity that Starlette is designed on promotes building re-usable components that can be shared between any ASGI framework. This should enable an ecosystem of shared middleware and mountable applications. The clean API separation also means it's easier to understand each component in isolation. --- <p align="center"><i>Starlette is <a href="https://github.com/Kludex/starlette/blob/main/LICENSE.md">BSD licensed</a> code.<br/>Designed & crafted with care.</i></br>&mdash; â­ī¸ &mdash;</p> [asgi]: https://asgi.readthedocs.io/en/latest/ [httpx]: https://www.python-httpx.org/ [jinja2]: https://jinja.palletsprojects.com/ [python-multipart]: https://multipart.fastapiexpert.com/ [itsdangerous]: https://itsdangerous.palletsprojects.com/ [sqlalchemy]: https://www.sqlalchemy.org [pyyaml]: https://pyyaml.org/wiki/PyYAMLDocumentation [techempower]: https://www.techempower.com/benchmarks/#hw=ph&test=fortune&l=zijzen-sf

Release History

VersionChangesUrgencyDate
1.0.0Imported from PyPI (1.0.0)Low4/21/2026

Dependencies & License Audit

Loading dependencies...

Similar Packages

schemathesisProperty-based testing framework for Open API and GraphQL based appsv4.21.1
ctranslate2Fast inference engine for Transformer modelsv4.8.0
cadwynProduction-ready community-driven modern Stripe-like API versioning in FastAPI7.0.0
tqdmFast, Extensible Progress Meterv4.68.1
inspect-aiFramework for large language model evaluationsmain@2026-06-05

More from pypi

markitdownUtility tool for converting various files to Markdown
fastapiFastAPI framework, high performance, easy to learn, fast to code, ready for production
djangoA high-level Python web framework that encourages rapid development and clean, pragmatic design.
flaskA simple framework for building complex web applications.

More in Frameworks

schemathesisProperty-based testing framework for Open API and GraphQL based apps
spec_driven_developSpec-Driven Develop is a platform-agnostic AI agent skill that automates the pre-development workflow for large-scale complex tasks. It is not a framework, not a runtime, not a package manager — it is
DrasilGenerate all the things (focusing on research software)
langchainThe agent engineering platform