Skip to main content

stitch-eng-sdk

Python SDK for the Stitch workflow execution engine.

Install

pip install stitch-eng-sdk

Quickstart (Embedded Zero-Config Mode)

Stitch comes with an embedded Go binary so you don't even need to start a server locally!

import threading
import stitch

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

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

@stitch.workflow
def process_order(inp):
    # Pass the output of one task directly to the next to create a dependency!
    payment = charge_payment(order_id=inp["order_id"], amount=inp["amount"])
    send_email(email=inp["email"], txn_id=payment["txn_id"])

# 1. Start the embedded server and client
client = stitch.Client()

# 2. Start a background worker to poll for tasks
worker = stitch.Worker(client, tasks=[charge_payment, send_email])
threading.Thread(target=worker.start, daemon=True).start()

# 3. Submit the workflow and wait for it to finish!
result = client.run(process_order, input={
    "order_id": "ORD-001",
    "amount": 9897,
    "email": "user@example.com",
}).wait()

print(result.status)  # → "completed"

worker.stop()
client.close()

Cloud Mode

To connect to the hosted Stitch backend, just pass your API key — the server URL is handled automatically:

client = stitch.Client(api_key="sk_your_api_key")

Full Cloud Example

import threading
import stitch

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

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

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

# Connect to Stitch Cloud
client = stitch.Client(api_key="sk_your_api_key")

# Start a background worker
worker = stitch.Worker(client, tasks=[charge_payment, send_email])
threading.Thread(target=worker.start, daemon=True).start()

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

print(result.status)  # → "completed"

worker.stop()
client.close()

Metadata

Release files for stitch-eng-sdk 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stitch-eng-sdk 0.2.3
File Size Uploaded Provenance Actions
stitch_eng_sdk-0.2.3.tar.gz 38.1 MB Without provenance Details for stitch_eng_sdk-0.2.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for stitch-eng-sdk 0.2.3
File Interpreter ABI Platform Actions
stitch_eng_sdk-0.2.3-py3-none-any.whl Python 3 none any Details for stitch_eng_sdk-0.2.3-py3-none-any.whl

Total release size: 76.7 MB

Release files / stitch_eng_sdk-0.2.3.tar.gz

Download URL stitch_eng_sdk-0.2.3.tar.gz
Size 38.1 MB
Tags Source
SHA-256 checksum
How to use checksums
f453a968b9fe393de0e9633bed1ef099e0e92da0f6a2fc8ce3d7b7e4f374a27e
BLAKE2b-256 checksum
How to use checksums
ee30039bd6c8f1cd9bc899276cda4e0b315fcfbeb8aabccc72f128bf2a962bbb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / stitch_eng_sdk-0.2.3-py3-none-any.whl

Download URL stitch_eng_sdk-0.2.3-py3-none-any.whl
Size 38.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
021009564bc3e42b4b3413bde6f54b1940292353deb26a6e303c01a552ad79b2
BLAKE2b-256 checksum
How to use checksums
bd3a103477b3dbd82106cb141928324f68b35c4155cfa6e99aa064b76971ae99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Security for stitch-eng-sdk 0.2.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page