a grpc request tool like requests
Project description
Grpc Invoke
This is a package for python grpc client like grpcurl.
As We know
grpc's work mode is generating client and server via proto file, But sometime we can't get the proto file.If you are facing the problem above, this tool may help you a lot.
Features
-
you can do requests without any proto object
-
you can request your grpc server like http
-
you can use dictionary as your request data
-
support stream
-
support asyncio
-
support tls
Getting Started
$ pip install grpc-invoke
from grpc_invoke.grpc_client import GrpcClient
with GrpcClient("localhost:50052", "Service", "method") as client:
resp = client.invoke(data={"data": "hello"}, header={"auth": "fdfefsssdffdg"})
print(resp)
Enjoy it!
Notice
You should enable your server reflection. what you have to do is:
server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
hello_pb2_grpc.add_HelloServicer_to_server(Greeter(), server)
# start
SERVICE_NAMES = (
hello_pb2.DESCRIPTOR.services_by_name['Hello'].full_name,
reflection.SERVICE_NAME,
)
# enable reflection
reflection.enable_server_reflection(SERVICE_NAMES, server)
# done
server.add_insecure_port('[::]:50052')
server.start()
server.wait_for_termination()
SERVICE_NAMES = (
hello_pb2.DESCRIPTOR.services_by_name['Hello'].full_name,
reflection.SERVICE_NAME,
)
reflection.enable_server_reflection(SERVICE_NAMES, server)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file grpc-invoke-0.0.5.tar.gz.
File metadata
- Download URL: grpc-invoke-0.0.5.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.6.3 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
caf08015a15da67ed90154c87829a699fbcd101209322bcbc6cfcbcbde29e6ea
|
|
| MD5 |
d2f65ad8bee4e9e771e7a077579de3ef
|
|
| BLAKE2b-256 |
6659fa7a57877908b4a693cd304ac49a7ef3469f40c3454eb4284e622ac8cca0
|
File details
Details for the file grpc_invoke-0.0.5-py3-none-any.whl.
File metadata
- Download URL: grpc_invoke-0.0.5-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.6.3 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9122843470ef727340eb1262f84eed9ac481d2342b799332e151ac3b0cb6a603
|
|
| MD5 |
d484bab1bbf1b791649edadf7d2fef09
|
|
| BLAKE2b-256 |
27a1d58288fd1ee71c14217367fb2efc19325a3902a6db9bb48f5725ae12b3a7
|