grpc for Humans. grpc reflection support client
Low maintenance activity. Last release 20 months ago, commits in 0 of the last 26 weeks. Weaker on commit activity and recent releases.
pip install grpc-requestsgrpc_requests
GRPC for Humans
Leverage reflection to interact with GRPC in a familiar manner for users of the requests library.
from grpc_requests import Client
client = Client.get_by_endpoint("localhost:50051")
assert client.service_names == ["helloworld.Greeter"]
request_data = {"name": "sinsky"}
say_hello_response = client.request("helloworld.Greeter", "SayHello", request_data)
assert say_hello_response == {"message":"Hello sinsky!"}
Features
- Create a client easily when connecting to servers implementing grpc reflection
- Still support creating a client from stubs when reflection isn't available
- All unary and stream methods supported
- TLS and compression connections supported
- AsyncIO API supported
Install
pip install grpc_requests
Usage
In short:
Instantiate a client using the URL of a GRPC server and any authentication credentials you may need. If the server utilizes SSL (and it probably does) make sure to toggle that flag.