Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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:

And the following extensions, installed as extras on the core dapr package:

  • dapr.ext.databricks: Databricks Lakeflow streaming sink for Dapr Workflow — pip install "dapr[databricks]"
  • dapr.ext.fastapi: FastAPI integration (actors, pub/sub) — pip install "dapr[fastapi]"
  • dapr.ext.flask: Flask integration (actors, pub/sub) — pip install "dapr[flask]"
  • dapr.ext.grpc: gRPC AppCallback server — pip install "dapr[grpc]"
  • dapr.ext.langgraph: LangGraph checkpoint persistence — pip install "dapr[langgraph]"
  • dapr.ext.strands: Strands agent session management — pip install "dapr[strands]"
  • dapr.ext.workflow: Durable workflow authoring — pip install "dapr[workflow]"

Getting started

Prerequisites

Install Dapr python sdk

  • Official package
# Install the Dapr client SDK
pip3 install dapr

# Install one or more extensions as extras
pip3 install "dapr[fastapi]"
pip3 install "dapr[grpc,workflow]"

# Or install everything
pip3 install "dapr[all]"

Migration from legacy distributions. The previously-separate packages (dapr-ext-fastapi, dapr-ext-grpc, dapr-ext-langgraph, dapr-ext-strands, dapr-ext-workflow, flask-dapr) are now extras on the core dapr package and are no longer published standalone. Import paths under dapr.ext.* are unchanged.

Existing installs must run all three steps below in order so pip rewrites the bundled files the legacy uninstall removes, without churning pinned transitive deps (fastapi, uvicorn, langchain, etc.):

pip uninstall -y dapr-ext-fastapi dapr-ext-grpc dapr-ext-langgraph dapr-ext-strands dapr-ext-workflow flask-dapr
pip install --force-reinstall --no-deps dapr
pip install "dapr[fastapi,workflow]"

import dapr emits a FutureWarning with the recovery command if the migration is skipped. Suppress with DAPR_SKIP_LEGACY_CHECK=1. The legacy flask_dapr top-level import remains as a thin shim that also emits a FutureWarning; the canonical path is dapr.ext.flask.

  • In-development version

Only tagged releases are published to PyPI. To install the in-development version (the current state of main), point pip at the GitHub repository:

# Install the latest dev build of the Dapr client sdk
pip3 install "dapr @ git+https://github.com/dapr/python-sdk.git@main"

# Install the latest dev build of the gRPC AppCallback and FastAPI for Actor extensions
pip3 install "dapr[grpc,fastapi] @ git+https://github.com/dapr/python-sdk.git@main"

Replace @main with a commit SHA or release branch (e.g. @release-1.19) to pin to a specific point in history.

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

To run tests/examples/ or tests/integration/ (steps 7 and 8), sync the tests group instead. It includes everything in dev plus the dependencies those suites need — notably langchain-ollama, which examples/langgraph-checkpointer imports. This is what CI installs for both of those jobs:

uv sync --all-packages --group tests
  1. Run linter and autofix
uv run ruff check --fix && uv run ruff format
  1. Run unit tests
# pytest is required: `unittest discover` silently skips the pytest-style
# tests under tests/ext/flask and tests/ext/workflow/durabletask.
uv run pytest -m "not e2e" ./tests --ignore=tests/integration --ignore=tests/examples
  1. Run type check
uv run mypy
  1. Run integration tests (requires a Dapr runtime and the tests group)
uv run pytest tests/integration/
  1. Validate the examples (requires a Dapr runtime and the tests group)
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.19 # 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.

Metadata

Release files for dapr 1.19.0rc4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for dapr 1.19.0rc4
File Interpreter ABI Platform
dapr-1.19.0rc4-py3-none-any.whl Python 3 none any Details

Release files / dapr-1.19.0rc4-py3-none-any.whl

Download URL dapr-1.19.0rc4-py3-none-any.whl
Size 624.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5636c29bab3c03e0274d58e6cfba06d62edec0d37f307bae0efa84f4e1b1873b
BLAKE2b-256 checksum
How to use checksums
cbba2317ae6f34c10a17bb057a3e24e76afe7889efd143b7de1cc773f12c82b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Security for dapr 1.19.0rc4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page