Skip to main content

Python SDK for authoring Cadence workflows and activities

Project description

Cadence Python SDK

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 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:

pip install cadence-python-client

Or with uv:

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:

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

Development

Setup

  1. Install protobuf (required):

    # macOS
    brew install protobuf@29
    
    # Linux/Other
    # Install protobuf 29.x via your package manager
    
  2. Install uv (recommended):

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

    uv sync --all-extras
    

    Or if you prefer traditional pip:

    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/:

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

make lint
make type-check
make test

Run integration tests with Docker:

make integration-test

You can also verify the generated files manually:

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:

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

License

Apache 2.0 License, please see LICENSE for details.

Project details


Download files

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

Source Distribution

cadence_python_client-0.3.0.tar.gz (471.9 kB view details)

Uploaded Source

Built Distribution

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

cadence_python_client-0.3.0-py3-none-any.whl (325.5 kB view details)

Uploaded Python 3

File details

Details for the file cadence_python_client-0.3.0.tar.gz.

File metadata

  • Download URL: cadence_python_client-0.3.0.tar.gz
  • Upload date:
  • Size: 471.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cadence_python_client-0.3.0.tar.gz
Algorithm Hash digest
SHA256 1e2f8d277100a77b1e322c10b5bfc6c0f731f77b0c81af7226de5d69bebbeda7
MD5 d81a799edaf89fb7337105cabb6e6479
BLAKE2b-256 213feb48275117d29efeef3b6242979cf588b867ada1f8776af5681dd94bc861

See more details on using hashes here.

Provenance

The following attestation bundles were made for cadence_python_client-0.3.0.tar.gz:

Publisher: python-publish.yml on cadence-workflow/cadence-python-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cadence_python_client-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cadence_python_client-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 886214ad43c844f5fa8af1cce3a28433560380ba0c2814da908af8fa99632648
MD5 c4c24357da10cd9fd442799394b815f4
BLAKE2b-256 df501ea448e0ec09c4a41cbb6488b5e1f053a6d4b1868fb2d8f75f3baa201e16

See more details on using hashes here.

Provenance

The following attestation bundles were made for cadence_python_client-0.3.0-py3-none-any.whl:

Publisher: python-publish.yml on cadence-workflow/cadence-python-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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