Metadata-Version: 2.5
Name: dapr
Version: 1.19.0rc1
Summary: The official release of Dapr Python SDK.
Project-URL: Documentation, https://github.com/dapr/docs
Project-URL: Source, https://github.com/dapr/python-sdk
Author-email: Dapr Authors <dapr@dapr.io>
License: Apache-2.0
License-File: LICENSE
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Requires-Dist: aiohttp<4.0.0,>=3.9.5
Requires-Dist: grpcio-status<2.0.0,>=1.81.1
Requires-Dist: grpcio<2.0.0,>=1.81.1
Requires-Dist: protobuf<8.0.0,>=6.33.5
Requires-Dist: python-dateutil<3.0.0,>=2.8.1
Requires-Dist: typing-extensions<5.0.0,>=4.4.0
Provides-Extra: all
Requires-Dist: azure-identity<2.0.0,>=1.15.0; extra == 'all'
Requires-Dist: azure-search-documents<12.0.0,>=11.5.0; extra == 'all'
Requires-Dist: azure-storage-blob<13.0.0,>=12.19.0; extra == 'all'
Requires-Dist: boto3<2.0.0,>=1.34.0; extra == 'all'
Requires-Dist: cloudevents<2.0.0,>=1.0.0; extra == 'all'
Requires-Dist: fastapi<1.0.0,>=0.60.1; extra == 'all'
Requires-Dist: flask<4.0.0,>=1.1.4; extra == 'all'
Requires-Dist: httpx<1.0.0,>=0.27.0; extra == 'all'
Requires-Dist: langchain-core<2.0.0,>=0.3.0; extra == 'all'
Requires-Dist: langchain<2.0.0,>=0.1.17; extra == 'all'
Requires-Dist: langgraph<2.0.0,>=0.3.6; extra == 'all'
Requires-Dist: msgpack<2.0,>=1.0; extra == 'all'
Requires-Dist: openai<2.0.0,>=1.50.0; extra == 'all'
Requires-Dist: pinecone<8.0.0,>=5.0.0; extra == 'all'
Requires-Dist: psycopg[binary]<4.0.0,>=3.1.0; extra == 'all'
Requires-Dist: python-ulid<5.0.0,>=3.0.0; extra == 'all'
Requires-Dist: strands-agents<2.0.0,>=1.30.0; extra == 'all'
Requires-Dist: uvicorn<1.0.0,>=0.11.6; extra == 'all'
Provides-Extra: databricks
Provides-Extra: fastapi
Requires-Dist: fastapi<1.0.0,>=0.60.1; extra == 'fastapi'
Requires-Dist: uvicorn<1.0.0,>=0.11.6; extra == 'fastapi'
Provides-Extra: flask
Requires-Dist: flask<4.0.0,>=1.1.4; extra == 'flask'
Provides-Extra: grpc
Requires-Dist: cloudevents<2.0.0,>=1.0.0; extra == 'grpc'
Provides-Extra: langgraph
Requires-Dist: langchain<2.0.0,>=0.1.17; extra == 'langgraph'
Requires-Dist: langgraph<2.0.0,>=0.3.6; extra == 'langgraph'
Requires-Dist: msgpack<2.0,>=1.0; extra == 'langgraph'
Requires-Dist: python-ulid<5.0.0,>=3.0.0; extra == 'langgraph'
Provides-Extra: rag
Requires-Dist: openai<2.0.0,>=1.50.0; extra == 'rag'
Provides-Extra: rag-azure
Requires-Dist: azure-identity<2.0.0,>=1.15.0; extra == 'rag-azure'
Requires-Dist: azure-storage-blob<13.0.0,>=12.19.0; extra == 'rag-azure'
Provides-Extra: rag-azure-search
Requires-Dist: azure-search-documents<12.0.0,>=11.5.0; extra == 'rag-azure-search'
Requires-Dist: httpx<1.0.0,>=0.27.0; extra == 'rag-azure-search'
Provides-Extra: rag-langchain
Requires-Dist: langchain-core<2.0.0,>=0.3.0; extra == 'rag-langchain'
Provides-Extra: rag-pgvector
Requires-Dist: psycopg[binary]<4.0.0,>=3.1.0; extra == 'rag-pgvector'
Provides-Extra: rag-pinecone
Requires-Dist: pinecone<8.0.0,>=5.0.0; extra == 'rag-pinecone'
Provides-Extra: rag-s3
Requires-Dist: boto3<2.0.0,>=1.34.0; extra == 'rag-s3'
Provides-Extra: rag-unstructured
Requires-Dist: unstructured[docx,md,pdf]<1.0.0,>=0.15.0; extra == 'rag-unstructured'
Provides-Extra: strands
Requires-Dist: msgpack<2.0,>=1.0; extra == 'strands'
Requires-Dist: python-ulid<5.0.0,>=3.0.0; extra == 'strands'
Requires-Dist: strands-agents<2.0.0,>=1.30.0; extra == 'strands'
Provides-Extra: workflow
Description-Content-Type: text/markdown

# Dapr SDK for Python

[![PyPI - Version](https://img.shields.io/pypi/v/dapr?style=flat&logo=pypi&logoColor=white&label=Latest%20version)](https://pypi.org/project/dapr/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/dapr?style=flat&logo=pypi&logoColor=white&label=Downloads)](https://pypi.org/project/dapr/)
[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/dapr/python-sdk/.github%2Fworkflows%2Fbuild.yaml?branch=main&label=Build&logo=github)](https://github.com/dapr/python-sdk/actions/workflows/build.yaml)
[![codecov](https://codecov.io/gh/dapr/python-sdk/branch/main/graph/badge.svg)](https://codecov.io/gh/dapr/python-sdk)
[![GitHub License](https://img.shields.io/github/license/dapr/python-sdk?style=flat&label=License&logo=github)](https://github.com/dapr/python-sdk/blob/main/LICENSE)
[![GitHub issue custom search in repo](https://img.shields.io/github/issues-search/dapr/python-sdk?query=type%3Aissue%20is%3Aopen%20label%3A%22good%20first%20issue%22&label=Good%20first%20issues&style=flat&logo=github)](https://github.com/dapr/python-sdk/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
[![Discord](https://img.shields.io/discord/778680217417809931?label=Discord&style=flat&logo=discord)](http://bit.ly/dapr-discord)
[![YouTube Channel Views](https://img.shields.io/youtube/channel/views/UCtpSQ9BLB_3EXdWAUQYwnRA?style=flat&label=YouTube%20views&logo=youtube)](https://youtube.com/@daprdev)
<!-- IGNORE_LINKS -->
[![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/daprdev?logo=x&style=flat)](https://twitter.com/daprdev)
<!-- END_IGNORE -->

[Dapr](https://docs.dapr.io/concepts/overview/) 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](https://docs.dapr.io/developing-applications/building-blocks/actors/actors-overview/), 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](./dapr/actor): Actor Framework
* [dapr.clients](./dapr/clients): Dapr clients for Dapr building blocks
* [dapr.conf](./dapr/conf): Configuration
* [dapr.serializers](./dapr/serializers): serializer/deserializer
* [dapr.proto](./dapr/proto): Dapr gRPC autogenerated gRPC clients

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

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

## Getting started

### Prerequisites

* [Install Dapr standalone mode](https://github.com/dapr/cli#install-dapr-on-your-local-machine-self-hosted)
* [Install Python 3.10+](https://www.python.org/downloads/)

### Install Dapr python sdk

* Official package

```sh
# 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.):
>
> ```sh
> 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:

```sh
# 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](./examples)

## Developing

### Build and test

1. Install [uv](https://docs.astral.sh/uv/getting-started/installation/)

2. Clone python-sdk

```bash
git clone https://github.com/dapr/python-sdk.git
cd python-sdk
```

3. Install all packages and dev dependencies

```bash
uv sync --all-packages --group dev
```

4. Run linter and autofix

```bash
uv run ruff check --fix && uv run ruff format
```

5. Run unit tests

```bash
# 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
```

6. Run type check

```bash
uv run mypy
```

7. Run integration tests

```bash
uv run pytest tests/integration/
```

8. Validate the examples

```bash
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](https://github.com/dapr/dapr/releases) 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:

```bash
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

```sh
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](https://discord.gg/MySdVxrH)).

## Code of Conduct

This project follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md).
