skillfed

granian

A Rust HTTP server for Python applications

granian v2.8.1 11.2M downloads/30d#1,408 on PyPI5,551
Permissive license BSD-3-Clause Active released

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 granian

uv

uv add granian

poetry

poetry add granian

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Free Threading :: 2 - BetaProgramming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyProgramming Language :: RustTopic :: Internet :: WWW/HTTP

Tags

rust http server pythonasgi wsgi serverhttp2 python application serverwebsocket server pythonhigh performance python web server
http-serverasgi-wsgirust-backed

More WWW/HTTP packages