Litestar Granian
Run Litestar applications with Granian while preserving Litestar startup, shutdown, logging, and server integrations.
Install
python -m pip install litestar-granian
Run your first app
Save this as example.py:
from litestar import Litestar, get
from litestar_granian import GranianPlugin
@get("/")
async def hello() -> dict[str, str]:
return {"hello": "world"}
app = Litestar(route_handlers=[hello], plugins=[GranianPlugin()])
Start the server:
litestar --app example:app run
Open http://127.0.0.1:8000/ in a browser, or run:
curl http://127.0.0.1:8000/
You should receive:
{"hello":"world"}
Press Ctrl+C in the server terminal to stop it.
Why use this plugin?
- Keep the familiar
litestar runcommand while using Granian. - Start Litestar server integrations once around all Granian workers.
- Configure workers, protocols, logging, metrics, and static files from one CLI.
What the plugin changes
GranianPlugin() replaces Litestar's standard run command with a
Granian-backed command. It does not change commands that start another ASGI
server directly.
Run the complete command reference with:
litestar --app example:app run --help
Optional event loops
The default installation uses Granian's standard loop selection and installs no optional event loop. Install and select one integration at a time:
python -m pip install "litestar-granian[uvloop]"
litestar --app example:app run --loop uvloop
On supported platforms, use the matching rloop or winloop extra and pass
--loop rloop or --loop winloop.
Next steps
- Quickstart — repeat the first run and learn what to check.
- Configuration — choose bindings, workers, protocols, TLS, reload, and event loops.
- Logging and metrics — see how Granian automatically matches Litestar's formatter or accepts a complete override.
- Deployment — forward signals and verify clean shutdown.
- CLI reference — browse every option and environment variable.
License
litestar-granian is distributed under the MIT License.
Metadata
Release files for litestar-granian 0.17.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| litestar_granian-0.17.0.tar.gz | 257.8 kB | With provenance | Details for litestar_granian-0.17.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| litestar_granian-0.17.0-py3-none-any.whl | Python 3 | none | any | Details for litestar_granian-0.17.0-py3-none-any.whl |
Total release size: 282.4 kB
Release files / litestar_granian-0.17.0.tar.gz
| Download URL | litestar_granian-0.17.0.tar.gz |
|---|---|
| Size | 257.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
defe84a7f4cf993d639ff931d221e313477a700ac7d6bd30ac38dd1578cc3f78
|
|
BLAKE2b-256 checksum How to use checksums |
af5e9d2a75445ab6dd3fd5ac604493d4b1a30e2644f7f24951e2c1bed9318144
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logRelease files / litestar_granian-0.17.0-py3-none-any.whl
| Download URL | litestar_granian-0.17.0-py3-none-any.whl |
|---|---|
| Size | 24.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
51770c6ebc18a2a1bade69507628369d2c58f10b6fc957902974f99b02d9cced
|
|
BLAKE2b-256 checksum How to use checksums |
ab8ba3a875aa3ecb8c53b1560dfa54a63c6d2124395c15e624f09b11c2e5e287
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logSecurity for litestar-granian 0.17.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for litestar_granian-0.17.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.