Metadata-Version: 2.4
Name: cadence-python-client
Version: 0.3.0
Summary: Python SDK for authoring Cadence workflows and activities
Author: Cadence
License: Apache-2.0
Project-URL: Homepage, https://cadenceworkflow.io/
Project-URL: Documentation, https://cadenceworkflow.io/docs/get-started
Project-URL: Repository, https://github.com/cadence-workflow/cadence-python-client
Project-URL: Bug Tracker, https://github.com/cadence-workflow/cadence-python-client/issues
Keywords: workflow,orchestration,distributed,async,cadence
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 :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Distributed Computing
Requires-Python: <3.14,>=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Requires-Dist: grpcio>=1.73.1
Requires-Dist: grpcio-status>=1.73.1
Requires-Dist: msgspec>=0.19.0
Requires-Dist: protobuf<7.0.0,>=6.31.0
Requires-Dist: typing-extensions>=4.0.0
Requires-Dist: prometheus-client>=0.21.0
Provides-Extra: dev
Requires-Dist: grpcio-tools>=1.73.1; extra == "dev"
Requires-Dist: grpc-stubs>=1.53.0.6; extra == "dev"
Requires-Dist: pytest>=8.4.1; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Requires-Dist: pytest-docker>=3.2.3; extra == "dev"
Requires-Dist: opentelemetry-instrumentation-grpc==0.60b1; extra == "dev"
Requires-Dist: opentelemetry-sdk>=1.39.1; extra == "dev"
Requires-Dist: setuptools-scm[simple]>=9.2; extra == "dev"
Requires-Dist: types-grpcio>=1.0.0.20260408; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx>=6.0.0; extra == "docs"
Requires-Dist: sphinx-rtd-theme>=1.2.0; extra == "docs"
Requires-Dist: myst-parser>=1.0.0; extra == "docs"
Provides-Extra: examples
Requires-Dist: requests>=2.28.0; extra == "examples"
Requires-Dist: aiohttp>=3.8.0; extra == "examples"
Provides-Extra: openai
Requires-Dist: openai>=0.27.10; extra == "openai"
Requires-Dist: openai-agents>=0.12.5; extra == "openai"
Dynamic: license-file

# Cadence Python SDK

[Cadence](https://github.com/uber/cadence) is a distributed, scalable, durable, and highly available orchestration engine we developed at Uber Engineering to execute asynchronous long-running business logic in a scalable and resilient way.

If you'd like to propose a new feature, first join the [CNCF Slack workspace](https://communityinviter.com/apps/cloud-native/cncf) in the **#cadence-users** channel to start a discussion.

The Cadence Python SDK is the framework for authoring workflows and activities using the Python programming language.

## Installation

Install from [PyPI](https://pypi.org/project/cadence-python-client/):

```bash
pip install cadence-python-client
```

Or with `uv`:

```bash
uv add cadence-python-client
```

The core package supports Python `>=3.11,<3.14`.

The SDK is ready for production use using PYPI. To build from source, clone the repository and install the development dependencies.

Clone the repository if you want to develop locally:

```bash
git clone https://github.com/cadence-workflow/cadence-python-client.git
cd cadence-python-client
```

## Development

### Setup

1. **Install protobuf (required):**
   ```bash
   # macOS
   brew install protobuf@29

   # Linux/Other
   # Install protobuf 29.x via your package manager
   ```

2. **Install uv (recommended):**
   ```bash
   # macOS
   brew install uv

   # Linux/Other
   curl -LsSf https://astral.sh/uv/install.sh | sh
   source $HOME/.local/bin/env  # Add to your shell profile for persistence
   ```

3. **Create virtual environment and install dependencies:**
   ```bash
   uv sync --all-extras
   ```

   Or if you prefer traditional pip:
   ```bash
   python3.11 -m venv venv
   source venv/bin/activate  # Windows: venv\Scripts\activate
   pip install -e ".[dev]"
   ```

### Generate Protobuf and gRPC Files

Run the generation script only if you change files under `idls/proto/`:

```bash
# Recommended
make generate

# Or run the script directly
uv run python scripts/generate_proto.py
```

This will:
- Generate Python protobuf files in `cadence/api/v1/`
- Generate gRPC service files in `cadence/api/v1/`
- Refresh the package imports for the generated modules

### Test

Run the main checks:

```bash
make lint
make type-check
make test
```

Run integration tests with Docker:

```bash
make integration-test
```

You can also verify the generated files manually:

```bash
uv run python cadence/sample/simple_usage_example.py
uv run python cadence/sample/grpc_usage_example.py
```

### Development Commands

The current repository workflow is centered on `make` targets:

```bash
make install
make generate
make lint
make type-check
make test
make integration-test
make pr
```

## License

Apache 2.0 License, please see [LICENSE](LICENSE) for details.
