Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 835 Bytes

File metadata and controls

26 lines (20 loc) · 835 Bytes

This is example of how to use gRPC client in python. Specific use case is to call basic requests of Relation API.

Repository contains generated gRPC client in python which could generated by command:

python -m grpc_tools.protoc -I<PATH_OF_REPO>third_party -I<PATH_OF_REPO>protos/  --python_out=.  --pyi_out=. --grpc_python_out=. <PATH_OF_REPO>protos/relationships.proto

Folder protos and third_party are taken from insights-rebac repository.

Instalation

virtualenv myenv
source myenv/bin/activate
pip install grpcio
pip install grpcio-tools
pip install googleapis-common-protos

Run

Run client and call requests CreateRelationshipsRequest and ReadRelationshipsRequest:

 python client.py