Skip to main content

The official release of Dapr Python SDK.

Project description

Dapr SDK for Python

PyPI - Version PyPI - Downloads GitHub Actions Workflow Status codecov GitHub License GitHub issue custom search in repo Discord YouTube Channel Views

X (formerly Twitter) Follow

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:

Getting started

Prerequisites

Install Dapr python sdk

  • 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

# 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.

Try out examples

Go to Examples

Developing

Build and test

  1. Install uv

  2. Clone python-sdk

git clone https://github.com/dapr/python-sdk.git
cd python-sdk
  1. Install all packages and dev dependencies
uv sync --all-packages --group dev
  1. Run linter and autofix
uv run ruff check --fix && uv run ruff format
  1. Run unit tests
uv run python -m unittest discover -v ./tests
  1. Run type check
uv run mypy
  1. Run integration tests
uv run pytest tests/integration/
  1. Validate the examples
uv run pytest tests/examples/

If you need to run the examples or integration tests against a pre-released version of the runtime, you can use the following command:

  • Get your daprd runtime binary from here for your platform.
  • Copy the binary to your dapr home folder at $HOME/.dapr/bin/daprd. Or using dapr cli directly: dapr init --runtime-version <release version>
  • Now you can run the examples with uv run pytest tests/examples/ or the integration tests with uv run pytest tests/integration/.

Documentation

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:

uv run --with sphinx sphinx-apidoc -E -o docs/actor dapr/actor
uv run --with sphinx sphinx-apidoc -E -o docs/clients dapr/clients
uv run --with sphinx sphinx-apidoc -E -o docs/proto dapr/proto
uv run --with sphinx sphinx-apidoc -E -o docs/serializers dapr/serializers
uv run --with sphinx make html -C docs

The generated files will be found in docs/_build.

Generate gRPC Protobuf client

uv sync --all-packages --group dev
export DAPR_BRANCH=release-1.17 # Optional, defaults to master
uv run ./tools/regen_grpcclient.sh

Help & Feedback

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).

Code of Conduct

This project follows the CNCF Code of Conduct.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dapr-1.17.0.dev0.tar.gz (173.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dapr-1.17.0.dev0-py3-none-any.whl (244.9 kB view details)

Uploaded Python 3

File details

Details for the file dapr-1.17.0.dev0.tar.gz.

File metadata

  • Download URL: dapr-1.17.0.dev0.tar.gz
  • Upload date:
  • Size: 173.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for dapr-1.17.0.dev0.tar.gz
Algorithm Hash digest
SHA256 74c6c2e7d72b67e8bb530868ae4df55bfa1ab9c2139beda0ac1a3b758807fc64
MD5 fbf70e1667395f9e52940a1863511d1d
BLAKE2b-256 4ce5bfddc5faa0b1b9171ec623cdda8a9b40ece4b8056c5bd69713565707a2f6

See more details on using hashes here.

File details

Details for the file dapr-1.17.0.dev0-py3-none-any.whl.

File metadata

  • Download URL: dapr-1.17.0.dev0-py3-none-any.whl
  • Upload date:
  • Size: 244.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for dapr-1.17.0.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 bf77e02e5d9b544ecc51afaff16049518848b7f8b6d88912f9a694304345f73e
MD5 089048a418b08b497ec522fd758ebfff
BLAKE2b-256 b9c3b1ce203d8b5446bba83a243dde553e33605167cd4e5bf4fb43f0efcfa3fa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page