Dapr is a portable, event-driven, serverless runtime for building distributed applications across cloud and edge.
Dapr SDK for Python allows you to implement the Virtual Actor model, based on the actor design pattern. This SDK can run locally, in a container and in any distributed systems environment.
This includes the following packages:
- dapr.actor: Actor Framework
- dapr.clients: Dapr clients for Dapr building blocks
- dapr.conf: Configuration
- dapr.serializers: serializer/deserializer
- dapr.proto: Dapr gRPC autogenerated gRPC clients
- dapr.ext.grpc: gRPC extension for Dapr
- dapr.ext.fastapi: FastAPI extension (actor) for Dapr
- flask.dapr: Flask extension (actor) for Dapr
Note: Dapr SDK for python is currently under community development in alpha phase.
- Official package
# Install Dapr client sdk
pip3 install dapr
# Install Dapr gRPC AppCallback service extension
pip3 install dapr-ext-grpc
# Install Dapr Fast Api extension for Actor
pip3 install dapr-ext-fastapi
- Development package
# Install Dapr client sdk
pip3 install dapr-dev
# Install Dapr gRPC AppCallback service extension
pip3 install dapr-ext-grpc-dev
# Install Dapr Fast Api extension for Actor
pip3 install dapr-ext-fastapi-dev
Note: Do not install both packages.
Go to Examples
- Clone python-sdk
git clone https://github.com/dapr/python-sdk.git
cd python-sdk
- Install a project in a editable mode
pip3 install -e .
pip3 install -e ./ext/dapr-ext-grpc/
pip3 install -e ./ext/dapr-ext-fastapi/
- Install required packages
pip3 install -r dev-requirements.txt
- Run linter
tox -e flake8
- Run unit-test
tox -e py37
- Run type check
tox -e type
- Run examples
tox -e examples
Documentation is generated using Sphinx. Extensions used are mainly Napoleon (To process the Google Comment Style) and Autodocs (For automatically generating documentation). The .rst
files are generated using Sphinx-Apidocs.
To generate documentation:
tox -e doc
The generated files will be found in docs/_build
.
pip3 install -r dev-requirements.txt
./tools/regen_grpcclient.sh
Need help or have feedback on the SDK? Please open a GitHub issue or come chat with us in the #python-sdk
channel of our Discord server (click here to join).
This project follows the CNCF Code of Conduct.