/supercharging-your-API-with-grpc

Code samples my talk at PyconKE 2018 on building APIs using gRPC

Primary LanguagePython

Supercharging your APIs with gRPC

Code walkthrough

Installation

Make a python virtual environment

$ python3 -m venv .venv && source .venv/bin/activate

Install the grpcio-tools package

$ pip install grpcio-tools

Install the googleapis-common-proto package

$ pip install googleapis-common-protos

Generating python-code

$ python -m grpc_tools.protoc -I $SRC_dIR --python_out=$DEST_DIR --grpc_python_out=. $SRC_DIR/$proto_file

working with examples

  1. Generate stubs
$ make stubs
  1. Start client
$ make client
  1. Start server
$ make server
  1. Generate ssl certs
$ make gen_key
References

gRPC documentation

Authetication

Using SSL

LoadBalancing gRPC blog