Granian is a Rust HTTP server for Python applications.
Granian addresses the need for a performant, unified HTTP server for Python by implementing a single correct HTTP implementation supporting versions 1 and 2 on top of Hyper and Tokio. Rather than composing multiple dependencies like Gunicorn, uvicorn, and http-tools, it provides a single package across platforms. The tool supports ASGI, WSGI, and RSGI interface applications, handles HTTPS and mTLS, includes WebSocket support, and can serve static files directly.
Granian suits projects prioritizing throughput and modern HTTP/2 performance for both ASGI and WSGI applications, particularly those needing strong concurrency capabilities with WebSockets. It is not the right choice if your application requires a pure Python solution, relies on trio or gevent, needs advanced debugging features, or depends on ASGI extensions not yet implemented in the tool. The README explicitly notes that existing alternatives exist but does not name them for comparison.
The project maintains active engagement with issues and feature requests, as evidenced by documented discussions around unimplemented ASGI extensions. Development appears focused on expanding protocol support, with HTTP/3 mentioned as an eventual addition. The tool integrates with Python's standard logging module rather than imposing its own logging system, reflecting attention to Python ecosystem conventions.