grpcreflect-py
An idiomatic Python implementation of the gRPC Server Reflection
protocol (grpc.reflection.v1 and
grpc.reflection.v1alpha), built on protobuf-py and
connectrpc. Modeled on Buf's Go reference
implementation, grpcreflect-go.
Since the reflection services here are just ConnectASGIApplications like
any other, they work over whichever of connectrpc's protocols your own
services already speak -- Connect, gRPC, and gRPC-Web -- with no extra
configuration.
Install
uv add grpcreflect-py
Usage
mount_reflection_handlers() takes the same ConnectASGIApplication
instances you're already mounting for your own services, derives a registry
from their descriptors, and returns them alongside ready-to-mount v1 and
v1alpha reflection applications:
from starlette.applications import Starlette
from starlette.routing import Mount
from grpcreflect.server import mount_reflection_handlers
from example.greet import GreetServiceImpl
from example.gen.greet.v1.greet_connect import GreetServiceASGIApplication
app = Starlette(
routes=[
Mount(a.path, app=a)
for a in mount_reflection_handlers(
GreetServiceASGIApplication(GreetServiceImpl())
)
]
)
ServerReflectionInfo is a bidirectional streaming RPC, which requires an
HTTP/2-capable ASGI server. As of this writing, pyvoy is the
server most reliably passing the Connect conformance suite's HTTP/2 and
bidi-streaming tests, so it's the recommended way to serve app above:
import asyncio
import pyvoy
async def main() -> None:
server = pyvoy.PyvoyServer("myapp:app", port=8080)
await server.start()
await server.wait()
asyncio.run(main())
You aren't required to use pyvoy -- any ASGI server with working HTTP/2
and bidi-streaming support will do -- but not every ASGI server reliably
supports both today.
Client
Client speaks gRPC Server Reflection against a server, preferring v1 and
falling back to v1alpha automatically the first time it discovers v1 isn't
implemented. new_stream() opens a ClientStream, which pins a sequence of
calls to one open stream so they're all answered by a single, consistent
view of the server's schema:
import asyncio
from grpcreflect.client import Client
async def main() -> None:
async with Client("http://localhost:8080") as client, client.new_stream() as stream:
print(await stream.list_services())
for descriptor in await stream.file_containing_symbol("greet.v1.GreetService"):
print(descriptor.name)
asyncio.run(main())
Development
uv run -- buf generate # regenerate src/grpcreflect/_gen from the upstream schema
uv run pytest
Metadata
Release files for grpcreflect-py 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| grpcreflect_py-0.1.1.tar.gz | 18.9 kB | With provenance | Details for grpcreflect_py-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| grpcreflect_py-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for grpcreflect_py-0.1.1-py3-none-any.whl |
Total release size: 45.7 kB
Release files / grpcreflect_py-0.1.1.tar.gz
| Download URL | grpcreflect_py-0.1.1.tar.gz |
|---|---|
| Size | 18.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d58d0e12108211bcbc4dc5e634465477c2d81de29b950177a0eb1de96a5a1d13
|
|
BLAKE2b-256 checksum How to use checksums |
98dd27a3c58636c9cac8e2b28dbf84cfd1bc8c372bbb20bdd107e1eb3795e6a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logRelease files / grpcreflect_py-0.1.1-py3-none-any.whl
| Download URL | grpcreflect_py-0.1.1-py3-none-any.whl |
|---|---|
| Size | 26.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c53fabc82e40b5079e96c9ea48dbc23873edd059c2a11a9718256f968ce79677
|
|
BLAKE2b-256 checksum How to use checksums |
1d3e3f5eb2fd575d2c3b0a9b287b0da8e132144a8bbb2f65eabd0185520f713d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logSecurity for grpcreflect-py 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for grpcreflect_py-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.