starlette 0.48.0


pip install starlette

  Latest version

Released: Sep 13, 2025


Meta
Author: Tom Christie, Marcelo Trylesinski
Requires Python: >=3.9

Classifiers

Development Status
  • 3 - Alpha

Environment
  • Web Environment

Framework
  • AnyIO

Intended Audience
  • Developers

License
  • OSI Approved :: BSD License

Operating System
  • OS Independent

Programming Language
  • Python :: 3
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14

Topic
  • Internet :: WWW/HTTP

starlette-logo

✨ The little ASGI framework that shines. ✨


Build Status Package version Supported Python Version


Documentation: https://www.starlette.io

Source Code: https://github.com/Kludex/starlette


Starlette

Starlette is a lightweight 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.

Installation

$ pip install starlette

You'll also want to install an ASGI server, such as uvicorn, daphne, or hypercorn.

$ pip install uvicorn

Example

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:

$ uvicorn main:app

Dependencies

Starlette only requires anyio, and the following are optional:

  • httpx - Required if you want to use the TestClient.
  • jinja2 - Required if you want to use Jinja2Templates.
  • python-multipart - Required if you want to support form parsing, with request.form().
  • itsdangerous - Required for SessionMiddleware support.
  • 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.

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:

$ 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.


Starlette is BSD licensed code.
Designed & crafted with care.

— ⭐️ —

0.48.0 Sep 13, 2025
0.47.3 Aug 24, 2025
0.47.2 Jul 20, 2025
0.47.1 Jun 21, 2025
0.47.0 May 29, 2025
0.46.2 Apr 13, 2025
0.46.1 Mar 08, 2025
0.46.0 Feb 22, 2025
0.45.3 Jan 24, 2025
0.45.2 Jan 04, 2025
0.45.1 Dec 30, 2024
0.45.0 Dec 29, 2024
0.44.0 Dec 28, 2024
0.43.0 Dec 25, 2024
0.42.0 Dec 14, 2024
0.41.3 Nov 18, 2024
0.41.2 Oct 27, 2024
0.41.1 Oct 24, 2024
0.41.0 Oct 15, 2024
0.40.0 Oct 15, 2024
0.39.2 Sep 29, 2024
0.39.1 Sep 25, 2024
0.39.0 Sep 23, 2024
0.38.6 Sep 22, 2024
0.38.5 Sep 08, 2024
0.38.4 Sep 01, 2024
0.38.3 Sep 01, 2024
0.38.2 Jul 27, 2024
0.38.1 Jul 23, 2024
0.38.0 Jul 20, 2024
0.37.2 Mar 05, 2024
0.37.1 Feb 09, 2024
0.37.0 Feb 05, 2024
0.36.3 Feb 04, 2024
0.36.2 Feb 03, 2024
0.36.1 Jan 23, 2024
0.36.0 Jan 22, 2024
0.35.1 Jan 11, 2024
0.35.0 Jan 11, 2024
0.34.0 Dec 16, 2023
0.33.0 Dec 01, 2023
0.32.0.post1 Nov 06, 2023
0.32.0 Nov 04, 2023
0.31.1 Aug 26, 2023
0.31.0 Jul 24, 2023
0.30.0 Jul 13, 2023
0.29.0 Jul 13, 2023
0.28.0 Jun 07, 2023
0.27.0 May 16, 2023
0.26.1 Mar 13, 2023
0.26.0.post1 Mar 09, 2023
0.26.0 Mar 09, 2023
0.25.0 Feb 14, 2023
0.24.0 Feb 06, 2023
0.23.1 Dec 09, 2022
0.23.0 Dec 05, 2022
0.22.0 Nov 17, 2022
0.21.0 Sep 26, 2022
0.20.4 Jun 28, 2022
0.20.3 Jun 10, 2022
0.20.2 Jun 07, 2022
0.20.1 May 28, 2022
0.20.0 May 03, 2022
0.19.1 Apr 22, 2022
0.19.0 Mar 09, 2022
0.18.0 Jan 23, 2022
0.17.1 Nov 17, 2021
0.17.0 Nov 04, 2021
0.16.0 Jul 19, 2021
0.15.0 Jun 23, 2021
0.14.2 Feb 02, 2021
0.14.1 Nov 09, 2020
0.14.0 Nov 08, 2020
0.13.8 Aug 14, 2020
0.13.7 Aug 05, 2020
0.13.6 Jul 20, 2020
0.13.5 Jul 17, 2020
0.13.4 Apr 30, 2020
0.13.3 Apr 15, 2020
0.13.2 Feb 20, 2020
0.13.1 Jan 30, 2020
0.13.0 Nov 13, 2019
0.12.13 Nov 04, 2019
0.12.12 Nov 01, 2019
0.12.11 Nov 01, 2019
0.12.10 Oct 15, 2019
0.12.9 Sep 02, 2019
0.12.8 Aug 16, 2019
0.12.7 Aug 01, 2019
0.12.6 Jul 29, 2019
0.12.5 Jul 25, 2019
0.12.4 Jul 16, 2019
0.12.3 Jul 15, 2019
0.12.2 Jul 04, 2019
0.12.1 Jun 19, 2019
0.12.0 May 21, 2019
0.12.0b3 Apr 03, 2019
0.12.0b2 Apr 02, 2019
0.12.0b1 Mar 20, 2019
0.11.4 Mar 18, 2019
0.11.3 Feb 26, 2019
0.11.2 Feb 20, 2019
0.11.1 Feb 19, 2019
0.11.0 Feb 19, 2019
0.10.7 Feb 20, 2019
0.10.6 Feb 19, 2019
0.10.5 Feb 18, 2019
0.10.4 Feb 18, 2019
0.10.3 Feb 14, 2019
0.10.2 Feb 11, 2019
0.10.1 Jan 30, 2019
0.10.0 Jan 25, 2019
0.9.11 Jan 23, 2019
0.9.10 Jan 15, 2019
0.9.9 Dec 14, 2018
0.9.8 Dec 10, 2018
0.9.7 Dec 07, 2018
0.9.6 Dec 07, 2018
0.9.5 Dec 06, 2018
0.9.4 Dec 05, 2018
0.9.3 Dec 05, 2018
0.9.2 Dec 04, 2018
0.9.1 Nov 28, 2018
0.9.0 Nov 28, 2018
0.8.8 Nov 23, 2018
0.8.7 Nov 23, 2018
0.8.6 Nov 22, 2018
0.8.5 Nov 16, 2018
0.8.4 Nov 09, 2018
0.8.3 Nov 09, 2018
0.8.2 Nov 08, 2018
0.8.1 Nov 08, 2018
0.8.0 Nov 08, 2018
0.7.4 Nov 07, 2018
0.7.3 Nov 06, 2018
0.7.2 Nov 06, 2018
0.7.1 Nov 05, 2018
0.7.0 Nov 01, 2018
0.6.3 Oct 30, 2018
0.6.2 Oct 29, 2018
0.6.1 Oct 29, 2018
0.6.0 Oct 29, 2018
0.5.5 Oct 22, 2018
0.5.4 Oct 18, 2018
0.5.3 Oct 18, 2018
0.5.2 Oct 18, 2018
0.5.1 Oct 17, 2018
0.5.0 Oct 17, 2018
0.4.2 Oct 15, 2018
0.4.1 Oct 12, 2018
0.4.0 Oct 10, 2018
0.3.7 Oct 10, 2018
0.3.6 Oct 09, 2018
0.3.5 Oct 08, 2018
0.3.4 Oct 05, 2018
0.3.3 Oct 02, 2018
0.3.2 Sep 17, 2018
0.3.1 Sep 14, 2018
0.3.0 Sep 05, 2018
0.2.3 Sep 04, 2018
0.2.2 Aug 30, 2018
0.2.1 Aug 30, 2018
0.2.0 Aug 28, 2018
0.1.17 Aug 27, 2018
0.1.16 Aug 17, 2018
0.1.15 Jul 26, 2018
0.1.14 Jul 18, 2018
0.1.13 Jul 18, 2018
0.1.12 Jul 18, 2018
0.1.11 Jul 13, 2018
0.1.10 Jul 13, 2018
0.1.9 Jul 12, 2018
0.1.8 Jul 12, 2018
0.1.7 Jul 11, 2018
0.1.6 Jul 10, 2018
0.1.5 Jun 27, 2018
0.1.4 Jun 26, 2018
0.1.3 Jun 26, 2018
0.1.2 Jun 25, 2018
0.1.1 Jun 25, 2018
0.1.0 Jun 25, 2018

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras:
Dependencies:
anyio (<5,>=3.6.2)
typing-extensions (>=4.10.0)