This is the Dapr SDK for Python, based on the auto-generated proto client.
For more info on Dapr and gRPC, visit this link.
The repository generates following package
- dapr
pip install dapr
Note: Depending on your OS, you may want to use pip3 instead of pip.
A client can be created as follows:
from dapr import dapr_pb2 as messages
from dapr import dapr_pb2_grpc as services
import grpc
from google.protobuf.any_pb2 import Any
channel = grpc.insecure_channel('localhost:50001')
client = services.DaprStub(channel)
You can find a complete example here
You can execute this code using the local dapr runtime:
dapr run --protocol grpc --grpc-port=50001 python example.py
Note: Depending on your OS, you may want to use python3 instead of python.
Package can be generated as:
cd src
python setup.py sdist bdist_wheel
Note: Depending on your OS, you may want to use python3 instead of python.
The package will be generated in src/dist directory. For more information on generating packages, see python documentation at https://packaging.python.org/tutorials/packaging-projects/