Metadata-Version: 2.4
Name: stitch-eng-sdk
Version: 0.1.0
Summary: Python SDK for the Stitch workflow execution engine
Author: Stitch Engineering
License-Expression: MIT
Project-URL: Homepage, https://github.com/stitch-eng/stitch
Project-URL: Source, https://github.com/stitch-eng/stitch
Project-URL: Issues, https://github.com/stitch-eng/stitch/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.23.0

# stitch-sdk

Python SDK for the [Stitch](https://github.com/stitch-eng/stitch) workflow execution engine.

## Install

```bash
pip install stitch-sdk
```

## Usage

```python
import stitch

@stitch.task
def charge_payment(order_id, amount):
    return {"txn_id": "txn_123"}

@stitch.task
def send_email(email, order_id):
    return {"sent": True}

@stitch.workflow
def process_order(input):
    charge_payment(order_id=input["order_id"], amount=input["amount"])
    send_email(email=input["email"], order_id=input["order_id"])

# Submit and wait
client = stitch.Client("http://localhost:8080")
result = client.run(process_order, input={
    "order_id": "ORD-001",
    "amount": 9897,
    "email": "user@example.com",
}).wait()

print(result.status)  # → "completed"
```

## Worker

```python
worker = stitch.Worker(client, tasks=[charge_payment, send_email])
worker.start()  # blocks, polls for tasks, executes them
```

## Requirements

- Python ≥ 3.9
- A running Stitch engine (`go build -o stitch ./cmd/stitch && ./stitch server start`)

## License

MIT
