Skip to main content

orchard-sdk

Python client SDK for the Orchard Flow REST API.

Call Groves, list providers, and trigger webhooks from any Python application. Supports both sync and async usage.

Install

pip install orchard-sdk

Or with test dependencies:

pip install "orchard-sdk[test]"

Quick Start

from orchard_sdk import OrchardClient

# Connect to an Orchard Flow API server
client = OrchardClient(
    base_url="http://localhost:8000",
    api_key="of_your_api_key_here",
)

# Run a Grove
result = client.run_grove("my_grove", soil={"key": "value"}, seed=42)
print(result["harvest"])

# List available providers
providers = client.list_providers()
print(providers)

# Check server health
if client.is_healthy():
    print("Server is online")

Async Usage

import asyncio
from orchard_sdk import OrchardClient

async def main():
    async with OrchardClient(
        base_url="http://localhost:8000",
        api_key="of_your_api_key_here",
    ) as client:
        # Run a Grove asynchronously
        result = await client.async_run_grove("my_grove", soil={"key": "value"})
        print(result)

        # List providers asynchronously
        providers = await client.async_list_providers()
        print(providers)

asyncio.run(main())

Trigger Webhooks

client = OrchardClient(base_url="http://localhost:8000", api_key="of_xxx")
result = client.trigger_webhook("my_grove", event="file.uploaded", data={"path": "/tmp/file.mp4"})

Error Handling

from orchard_sdk import OrchardClient
from orchard_sdk.errors import (
    OrchardNotFoundError,
    OrchardAuthenticationError,
    OrchardServerError,
    OrchardConnectionError,
    OrchardTimeoutError,
)

client = OrchardClient(base_url="http://localhost:8000", api_key="of_xxx")

try:
    result = client.run_grove("missing_grove")
except OrchardNotFoundError:
    print("Grove not found")
except OrchardAuthenticationError:
    print("Check your API key")
except OrchardConnectionError:
    print("Server is unreachable")
except OrchardTimeoutError:
    print("Request timed out")

API Reference

OrchardClient

Method Description
run_grove(name, soil, seed) Execute a Grove and return results
run_grove_model(name, soil, seed) Same but returns typed GroveRunResponse
list_providers() List all registered providers
trigger_webhook(name, event, data) Trigger a Grove via webhook
is_healthy() Check server connectivity

Async variants (prefixed async_) available for all methods.

Requirements

  • Python 3.11+
  • httpx >= 0.27
  • pydantic >= 2.0

Development

git clone https://github.com/MegistusAI/orchard-flow
cd orchard/sdks/python
pip install -e ".[test]"
pytest tests/

License

MIT

Metadata

Release files for orchard-sdk 0.1.1

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

Source distribution (sdist)

Source distribution for orchard-sdk 0.1.1
File Size Uploaded Provenance Actions
orchard_sdk-0.1.1.tar.gz 5.2 kB Without provenance Details for orchard_sdk-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for orchard-sdk 0.1.1
File Interpreter ABI Platform Actions
orchard_sdk-0.1.1-py3-none-any.whl Python 3 none any Details for orchard_sdk-0.1.1-py3-none-any.whl

Total release size: 10.5 kB

Release files / orchard_sdk-0.1.1.tar.gz

Download URL orchard_sdk-0.1.1.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ca374f30ba5502e3fc171a9308e205f5f50279dae9e1e2c86187b3c3daa01879
BLAKE2b-256 checksum
How to use checksums
86e4b8883b6c5d1930e3394067924bb57edddcf67ed870de3d6b6bf3f9da56a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release files / orchard_sdk-0.1.1-py3-none-any.whl

Download URL orchard_sdk-0.1.1-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d150c4335bdf96e5a65ca8f7d6c2499509af6ca0b64a5e58809ff84009a4cc3
BLAKE2b-256 checksum
How to use checksums
6bb3c9a336ad39e2978ffcc09d30492d17a0c5ca17139a719030be186ae2cc5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Security for orchard-sdk 0.1.1

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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