Metadata-Version: 2.4
Name: cadence-python-client
Version: 0.2.0
Summary: Python framework 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 :: 3 - Alpha
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: 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: black>=23.0.0; extra == "dev"
Requires-Dist: isort>=5.12.0; extra == "dev"
Requires-Dist: flake8>=6.0.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Requires-Dist: pre-commit>=3.0.0; extra == "dev"
Requires-Dist: pytest-docker>=3.2.3; 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"
Dynamic: license-file

# Python framework for Cadence

[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.

`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

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

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

```bash
# 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](LICENSE) for details.
