{"id":13415552,"url":"https://github.com/encode/starlette","last_synced_at":"2025-05-12T18:21:11.744Z","repository":{"id":37390899,"uuid":"138597372","full_name":"encode/starlette","owner":"encode","description":"The little ASGI framework that shines. 🌟","archived":false,"fork":false,"pushed_at":"2025-05-04T09:54:01.000Z","size":7085,"stargazers_count":10937,"open_issues_count":39,"forks_count":996,"subscribers_count":102,"default_branch":"master","last_synced_at":"2025-05-05T15:49:18.707Z","etag":null,"topics":["async","http","python","websockets"],"latest_commit_sha":null,"homepage":"https://www.starlette.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/encode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/contributing.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"Kludex"}},"created_at":"2018-06-25T13:16:21.000Z","updated_at":"2025-05-05T07:39:02.000Z","dependencies_parsed_at":"2022-07-09T14:00:26.384Z","dependency_job_id":"e8e7d8d6-5a08-4e31-bae9-f393bce03d01","html_url":"https://github.com/encode/starlette","commit_stats":{"total_commits":1322,"total_committers":292,"mean_commits":4.527397260273973,"dds":0.7065052950075643,"last_synced_commit":"c2e3a39b09a613553ee03586589ed9cd0fbf07f3"},"previous_names":[],"tags_count":172,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/encode%2Fstarlette","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/encode%2Fstarlette/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/encode%2Fstarlette/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/encode%2Fstarlette/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/encode","download_url":"https://codeload.github.com/encode/starlette/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253606119,"owners_count":21935123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","http","python","websockets"],"created_at":"2024-07-30T21:00:50.240Z","updated_at":"2025-05-12T18:21:11.711Z","avatar_url":"https://github.com/encode.png","language":"Python","readme":"\u003cp align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/encode/starlette/master/docs/img/starlette_dark.svg\" width=\"420px\"\u003e\n    \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/encode/starlette/master/docs/img/starlette.svg\" width=\"420px\"\u003e\n    \u003cimg alt=\"starlette-logo\" src=\"https://raw.githubusercontent.com/encode/starlette/master/docs/img/starlette_dark.svg\"\u003e\n  \u003c/picture\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cem\u003e✨ The little ASGI framework that shines. ✨\u003c/em\u003e\n\u003c/p\u003e\n\n---\n\n[![Build Status](https://github.com/encode/starlette/workflows/Test%20Suite/badge.svg)](https://github.com/encode/starlette/actions)\n[![Package version](https://badge.fury.io/py/starlette.svg)](https://pypi.python.org/pypi/starlette)\n[![Supported Python Version](https://img.shields.io/pypi/pyversions/starlette.svg?color=%2334D058)](https://pypi.org/project/starlette)\n\n---\n\n**Documentation**: \u003ca href=\"https://www.starlette.io/\" target=\"_blank\"\u003ehttps://www.starlette.io\u003c/a\u003e\n\n**Source Code**: \u003ca href=\"https://github.com/encode/starlette\" target=\"_blank\"\u003ehttps://github.com/encode/starlette\u003c/a\u003e\n\n---\n\n# Starlette\n\nStarlette is a lightweight [ASGI][asgi] framework/toolkit,\nwhich is ideal for building async web services in Python.\n\nIt is production-ready, and gives you the following:\n\n* A lightweight, low-complexity HTTP web framework.\n* WebSocket support.\n* In-process background tasks.\n* Startup and shutdown events.\n* Test client built on `httpx`.\n* CORS, GZip, Static Files, Streaming responses.\n* Session and Cookie support.\n* 100% test coverage.\n* 100% type annotated codebase.\n* Few hard dependencies.\n* Compatible with `asyncio` and `trio` backends.\n* Great overall performance [against independent benchmarks][techempower].\n\n## Installation\n\n```shell\n$ pip install starlette\n```\n\nYou'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/).\n\n```shell\n$ pip install uvicorn\n```\n\n## Example\n\n```python title=\"main.py\"\nfrom starlette.applications import Starlette\nfrom starlette.responses import JSONResponse\nfrom starlette.routing import Route\n\n\nasync def homepage(request):\n    return JSONResponse({'hello': 'world'})\n\nroutes = [\n    Route(\"/\", endpoint=homepage)\n]\n\napp = Starlette(debug=True, routes=routes)\n```\n\nThen run the application using Uvicorn:\n\n```shell\n$ uvicorn main:app\n```\n\n## Dependencies\n\nStarlette only requires `anyio`, and the following are optional:\n\n* [`httpx`][httpx] - Required if you want to use the `TestClient`.\n* [`jinja2`][jinja2] - Required if you want to use `Jinja2Templates`.\n* [`python-multipart`][python-multipart] - Required if you want to support form parsing, with `request.form()`.\n* [`itsdangerous`][itsdangerous] - Required for `SessionMiddleware` support.\n* [`pyyaml`][pyyaml] - Required for `SchemaGenerator` support.\n\nYou can install all of these with `pip install starlette[full]`.\n\n## Framework or Toolkit\n\nStarlette is designed to be used either as a complete framework, or as\nan ASGI toolkit. You can use any of its components independently.\n\n```python\nfrom starlette.responses import PlainTextResponse\n\n\nasync def app(scope, receive, send):\n    assert scope['type'] == 'http'\n    response = PlainTextResponse('Hello, world!')\n    await response(scope, receive, send)\n```\n\nRun the `app` application in `example.py`:\n\n```shell\n$ uvicorn example:app\nINFO: Started server process [11509]\nINFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)\n```\n\nRun uvicorn with `--reload` to enable auto-reloading on code changes.\n\n## Modularity\n\nThe modularity that Starlette is designed on promotes building re-usable\ncomponents that can be shared between any ASGI framework. This should enable\nan ecosystem of shared middleware and mountable applications.\n\nThe clean API separation also means it's easier to understand each component\nin isolation.\n\n---\n\n\u003cp align=\"center\"\u003e\u003ci\u003eStarlette is \u003ca href=\"https://github.com/encode/starlette/blob/master/LICENSE.md\"\u003eBSD licensed\u003c/a\u003e code.\u003cbr/\u003eDesigned \u0026 crafted with care.\u003c/i\u003e\u003c/br\u003e\u0026mdash; ⭐️ \u0026mdash;\u003c/p\u003e\n\n[asgi]: https://asgi.readthedocs.io/en/latest/\n[httpx]: https://www.python-httpx.org/\n[jinja2]: https://jinja.palletsprojects.com/\n[python-multipart]: https://multipart.fastapiexpert.com/\n[itsdangerous]: https://itsdangerous.palletsprojects.com/\n[sqlalchemy]: https://www.sqlalchemy.org\n[pyyaml]: https://pyyaml.org/wiki/PyYAMLDocumentation\n[techempower]: https://www.techempower.com/benchmarks/#hw=ph\u0026test=fortune\u0026l=zijzen-sf\n","funding_links":["https://github.com/sponsors/Kludex"],"categories":["Third-Party Packages","Python","HarmonyOS","Web Frameworks","Micro-frameworks","Async"],"sub_categories":["Async","Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fencode%2Fstarlette","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fencode%2Fstarlette","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fencode%2Fstarlette/lists"}