granian
A Rust HTTP server for Python applications
What it is and what it does
Granian is a production-ready HTTP server written in Rust that serves Python web applications. It acts as a single-package replacement for the traditional Gunicorn + uvicorn + http-tools stack on Unix systems, handling ASGI/3, RSGI, and WSGI application interfaces. The server is built on Hyper and Tokio, providing native HTTP/1 and HTTP/2 support, WebSocket handling, HTTPS and mTLS, and direct static file serving.
The package is designed for developers who prioritize throughput and modern HTTP protocol support. It requires only click as a runtime dependency and offers optional extras for environment file loading, process naming, reload-on-change, and alternative event loops (rloop, uvloop, winloop). Granian is not suitable if you need a pure Python solution, advanced debugging features, or support for trio/gevent-based applications.
Use it for:
- Serving high-throughput ASGI applications (FastAPI, Starlette) where HTTP/2 performance matters.
- Running WSGI applications (Flask, Django) with a modern, single-dependency server instead of Gunicorn.
- Building WebSocket-heavy applications that require great concurrency and low latency.
- Deploying Python applications where you want to avoid the complexity of multiple server components.
- Running on ARM or non-standard platforms where pre-built wheels reduce build friction.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Granian is a Rust-based HTTP server that runs ASGI, RSGI, and WSGI Python applications with support for HTTP/1, HTTP/2, WebSockets, and HTTPS.
Yes. Granian is actively maintained, has no known vulnerabilities, supports current Python versions (3.10–3.14), and offers a pragmatic alternative to traditional multi-component stacks. Install it if you're running ASGI or WSGI applications and want modern HTTP/2 support and high throughput with minimal dependencies. Skip it only if you require pure Python, advanced debugging, or async frameworks outside asyncio.
Install
granian on PyPI
pip
pip install granianuv
uv add granianpoetry
poetry add granianInstalling granian
Before you install
Medium install friction due to compiled wheels; however, the package maintains active development with a recent release and provides pre-built wheels for Python 3.10–3.14 across macOS, Linux, Windows, and ARM platforms, reducing build complexity for most users.
License in practice
BSD-3-Clause is a permissive license that allows commercial and private use with minimal restrictions, requiring only that you retain the license notice and disclaimer.
Quickstart
pip install granian
# Create main.py with an ASGI app:
async def app(scope, receive, send):
await send({'type': 'http.response.start', 'status': 200, 'headers': [[b'content-type', b'text/plain']]})
await send({'type': 'http.response.body', 'body': b'Hello, world!'})
# Run with: granian --interface asgi main:app
Requires Python 3.10 or later; compiled wheels are provided for common platforms but building from source requires Rust.
Verify before relying
- Whether the package's ASGI extension support (pathsend) covers all extensions your application requires.
- Performance characteristics under your specific workload and concurrency model compared to alternatives.
- Compatibility with async frameworks beyond asyncio (e.g., whether trio or gevent support is planned).
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 1 — click |
| Maintenance | actively maintained — 9 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 11,217,288/month — #1,408 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: granian-2.8.1-cp310-cp310-macosx_10_12_x86_64.whl; granian-2.8.1-cp310-cp310-macosx_11_0_arm64.whl; granian-2.8.1-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl; granian-2.8.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl; granian-2.8.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; granian-2.8.1-cp310-cp310-manylinux_2_28_aarch64.whl; granian-2.8.1-cp310-cp310-musllinux_1_1_aarch64.whl; granian-2.8.1-cp310-cp310-musllinux_1_1_armv7l.whl; granian-2.8.1-cp310-cp310-musllinux_1_1_x86_64.whl; granian-2.8.1-cp310-cp310-win_amd64.whl; granian-2.8.1-cp311-cp311-macosx_10_12_x86_64.whl; granian-2.8.1-cp311-cp311-macosx_11_0_arm64.whl; granian-2.8.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl; granian-2.8.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl; granian-2.8.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; granian-2.8.1-cp311-cp311-manylinux_2_28_aarch64.whl; granian-2.8.1-cp311-cp311-musllinux_1_1_aarch64.whl; granian-2.8.1-cp311-cp311-musllinux_1_1_armv7l.whl; granian-2.8.1-cp311-cp311-musllinux_1_1_x86_64.whl; granian-2.8.1-cp311-cp311-win_amd64.whl
Keywords: web, asyncio
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
uvicornUvicorn is an ASGI web server that runs async…
permissive · top 100 on PyPI
HypercornHypercorn is an ASGI and WSGI web server…
permissive · top 5,000 on PyPI
sanicSanic is an async Python web framework and…
permissive · top 5,000 on PyPI
falconFalcon is a minimalist ASGI/WSGI framework for…
permissive · top 5,000 on PyPI
gunicornGunicorn is a WSGI and ASGI HTTP server for…
permissive · top 1,000 on PyPI
uvicorn-workerIntegrates Uvicorn's ASGI server with…
permissive · top 5,000 on PyPI
servestaticServeStatic serves static files efficiently…
permissive · top 15,000 on PyPI
asgirefProvides ASGI base libraries including…
permissive · top 1,000 on PyPI
a2wsgiConverts between WSGI and ASGI applications…
permissive · top 5,000 on PyPI