grpclib
A pure-Python gRPC implementation for asyncio built on top of the hyper-h2 HTTP/2 stack.
Repository Health
Technical Analysis
grpclib is a pure-Python implementation of gRPC designed specifically for asyncio. Rather than wrapping the C-based grpc library, it builds directly on the hyper-h2 HTTP/2 protocol stack, giving you native async/await client channels and servers with full support for unary and streaming RPCs.
Beyond the core client and server, grpclib ships batteries-included support for the gRPC ecosystem: server reflection, health checking, channelz, an events system for interceptor-style middleware, and a protoc plugin that generates asyncio-friendly stubs. It is a natural fit for asyncio microservices that need first-class gRPC without blocking calls.
What You Get
- Async
Channelclient andServerprimitives for unary and streaming RPCs - A protoc plugin that generates asyncio-native gRPC stubs
- Built-in gRPC health checking, server reflection, and channelz support
- An events system for implementing interceptor-style middleware
- Testing utilities for exercising services without a real network
Common Use Cases
- Building asyncio microservices that expose or consume gRPC APIs
- Writing non-blocking gRPC clients inside async web services
- Implementing streaming RPCs over HTTP/2 without the native grpc library
- Adding health checks and reflection to Python gRPC services
Under The Hood
Architecture - The grpclib package separates concerns cleanly: client.py provides the Channel and typed stubs, server.py hosts the service handlers, and protocol.py/stream.py implement the HTTP/2 framing and streaming machinery on top of hyper-h2. Supporting subpackages add health, reflection, channelz, an encoding layer, an events middleware system, and a plugin package for the protoc code generator.
Tech Stack - Pure Python requiring 3.10+, built around h2 (hyper-h2) for the HTTP/2 protocol and protobuf for message serialization. It ships type information (py.typed) and integrates with the standard asyncio event loop rather than a bespoke runtime.
Code Quality - The project is well-tested, with a tests/ suite covering client channels, streaming, events, and server behavior, plus generated dummy protobuf fixtures. Type annotations, dedicated exception types, and a testing.py helper module indicate a mature, maintainable codebase, though recent development activity has slowed.
API Design - The API mirrors familiar gRPC concepts while embracing async idioms: async with Channel(host, port) as channel and await stub.Method(request) read naturally, and the protoc plugin generates stubs that match. Comprehensive documentation and an examples/ directory covering client, server, streaming, and interceptors keep onboarding straightforward for developers already familiar with gRPC and asyncio.
Used by 2 apps in this directory
Beta9
Developer Tools · AI Development · Data Engineering
Run AI workloads at scale with a Pythonic serverless runtime that handles GPU inference, background jobs, and sandboxes with zero infrastructure overhead.
Dify
No Code Platforms · AI Development · Developer Tools
Visual LLM workflow platform with RAG pipelines, agent capabilities, and model management for building production AI applications.