Skip to main content

Python framework for authoring Cadence workflows and activities

Project description

Python framework for Cadence

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.

cadence-python-client is the Python framework for authoring workflows and activities.

Disclaimer

This SDK is currently an early work-in-progress (WIP) and is NOT ready for production use.

  • This project is still in active development
  • It has not been published to any package repository (PyPI, etc.)
  • APIs and interfaces are subject to change without notice

Installation

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 venv
    uv pip install -e ".[dev]"
    

    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:

# Using uv (recommended)
uv sync --extra dev
uv run python scripts/generate_proto.py

# Or using traditional Python
python scripts/generate_proto.py

This will:

  • Download protoc 29.1 binary
  • Install grpcio-tools if needed
  • Generate Python protobuf files in cadence/api/v1/
  • Generate gRPC service files in cadence/api/v1/
  • Create proper package structure with both protobuf and gRPC imports

Test

Verify the generated files work:

# Using uv (recommended)
uv run python cadence/sample/simple_usage_example.py
uv run python cadence/sample/grpc_usage_example.py

# Or using traditional Python
python cadence/sample/simple_usage_example.py
python test_grpc_with_examples.py

Development Script

The project includes a development script that provides convenient commands for common tasks:

# Generate protobuf files
uv run python scripts/dev.py protobuf

# Run tests
uv run python scripts/dev.py test

# Run tests with coverage
uv run python scripts/dev.py test-cov

# Run linting
uv run python scripts/dev.py lint

# Format code
uv run python scripts/dev.py format

# Install in development mode
uv run python scripts/dev.py install

# Install with dev dependencies
uv run python scripts/dev.py install-dev

# Build package
uv run python scripts/dev.py build

# Clean build artifacts
uv run python scripts/dev.py clean

# Run all checks (lint + test)
uv run python scripts/dev.py check

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.2.0.tar.gz (116.1 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.2.0-py3-none-any.whl (153.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for cadence_python_client-0.2.0.tar.gz
Algorithm Hash digest
SHA256 54e01cff5d322fe2a1a1a15c858f51af4d0b43ea228659cbd5fb471464389000
MD5 42a6499afd83483570e36ade9dadd054
BLAKE2b-256 c2a448639df256766605c4c1f042d3b2db03a092cf28ff66256f7b650e089922

See more details on using hashes here.

Provenance

The following attestation bundles were made for cadence_python_client-0.2.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.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cadence_python_client-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ae18fdbc4c34e72ba5d7600a953477011c42789f7f28d535d1e0fe8599a79e1c
MD5 fd05f7db63ea7b06b74dcd0fb6caf5bc
BLAKE2b-256 a885838ab0d160d6f6def1f2611c7d38161bf4d841428a15aa31e9825bad8e12

See more details on using hashes here.

Provenance

The following attestation bundles were made for cadence_python_client-0.2.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