lpichler / hello-grpc-client-py-relation-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

License:Apache License 2.0


Languages

Language:Python 100.0%