Python SDK for the Stitch workflow execution engine
Project description
stitch-sdk
Python SDK for the Stitch workflow execution engine.
Install
pip install stitch-sdk
Usage
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
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
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
stitch_eng_sdk-0.1.0.tar.gz
(4.5 MB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stitch_eng_sdk-0.1.0.tar.gz.
File metadata
- Download URL: stitch_eng_sdk-0.1.0.tar.gz
- Upload date:
- Size: 4.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2c0bd6c44e3dd7b46b39684535861a0ffb34a3acccafb8773f36fa208e88ad4
|
|
| MD5 |
85a0ec011ef407b673f04d8131edb844
|
|
| BLAKE2b-256 |
1abbf5886e86afde989f91d63d7e0a7e3bd37af1afe801173bf7e3b99ad9fbc8
|
File details
Details for the file stitch_eng_sdk-0.1.0-py3-none-manylinux2014_x86_64.whl.
File metadata
- Download URL: stitch_eng_sdk-0.1.0-py3-none-manylinux2014_x86_64.whl
- Upload date:
- Size: 4.6 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4091eadc44d7000964998339a3d380d3fa954f35ca3d68071cd9f763d0498b6
|
|
| MD5 |
7dfb9742c58cfa94267b8f7058629112
|
|
| BLAKE2b-256 |
ace9c055b323278ca606b2ca5e01eeddd5bc239b3e9c28f4a6fe0b574266bcad
|