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.
virtualenv myenv
source myenv/bin/activate
pip install grpcio
pip install grpcio-tools
pip install googleapis-common-protos
Run client and call requests CreateRelationshipsRequest
and ReadRelationshipsRequest
:
python client.py