--- id: granian version: "2.8.1" license: BSD-3-Clause license_treatment: permissive maintenance: active --- # granian — A Rust HTTP server for Python applications License: permissive · Maintenance: active · Downloads: 11.2M/mo ## 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 above — 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 pip install granian uv add granian 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_current - Install friction: medium - Maintenance: active - Downloads: 11.2M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags rust http server python, asgi wsgi server, http2 python application server, websocket server python, high performance python web server, http-server, asgi-wsgi, rust-backed [View on SkillFed](https://skillfed.io/packages/granian) · [View on PyPI](https://pypi.org/project/granian/)