Skip to main content

cloacina-client

Python SDK for cloacina-server — a typed REST client plus WebSocket execution-event streaming, for Python 3.10+.

This is the service client. It talks to a running cloacina-server over HTTP/WebSocket. The embedded workflow runtime is the separate cloaca package — the two are deliberately distinct.

Version lockstep: cloacina-client X.Y.Z is generated from, tested against, and only supported on cloacina-server X.Y.Z.

Install

pip install cloacina-client

Quickstart

from cloacina_client import Client

client = Client("http://localhost:8080", api_key="clk_...", tenant="public")

accepted = client.execute_workflow("my_workflow", {"input": 42})
print(accepted.execution_id)

for execution in client.iterate_executions(status="Failed"):
    print(execution.id, execution.workflow_name)

Every helper raises CloacinaApiError (with .status and the server's machine-readable .code) on non-2xx responses. The generated openapi-python-client client is available as client.generated for anything the shim doesn't cover.

Async + live execution events

import asyncio
from cloacina_client import AsyncClient

async def main():
    client = AsyncClient("http://localhost:8080", api_key="clk_...")
    accepted = await client.execute_workflow("my_workflow", {"input": 42})
    # Reconnect, dedup, and acks are handled for you.
    async for event in client.follow_execution_events(accepted.execution_id):
        print(event)

asyncio.run(main())

WebSocket connections never carry the long-lived key: the SDK mints a single-use, 60-second ticket (POST /v1/auth/ws-ticket) per connection. A 4426 close (protocol version mismatch) raises ProtocolVersionError — upgrade the SDK.

Regenerating

src/cloacina_client/_generated/ is produced by a pinned generator from the committed server contract:

uvx openapi-python-client@0.29.0 generate \
  --path ../../docs/static/openapi.json \
  --config generator-config.yaml --meta none \
  --output-path src/cloacina_client/_generated --overwrite

Contract tests

tests/test_contract.py exercises every documented endpoint plus the WebSocket lifecycle against a live server:

CLOACINA_SERVER_URL=http://localhost:8080 \
CLOACINA_API_KEY=<bootstrap-key> \
uv run pytest

The full execute→event-stream flow (which needs a compiled .cloacina package) runs in the repo's angreal test sdk-contract harness.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cloacina_client-0.10.0.tar.gz (82.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cloacina_client-0.10.0-py3-none-any.whl (198.8 kB view details)

Uploaded Python 3

File details

Details for the file cloacina_client-0.10.0.tar.gz.

File metadata

  • Download URL: cloacina_client-0.10.0.tar.gz
  • Upload date:
  • Size: 82.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for cloacina_client-0.10.0.tar.gz
Algorithm Hash digest
SHA256 77e6ff573fd327d1019db276d76a6f177b2cd3f32a1ee3c6ef592b08acb7c531
MD5 841d82fb0bc70cb2c0daff2a8fd18f6a
BLAKE2b-256 0d8cb1be83fa54005228a5617741c412ab911acd0aa3193cfe1a17934b01e5df

See more details on using hashes here.

File details

Details for the file cloacina_client-0.10.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cloacina_client-0.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bae7c2532a8f76e53fe94f1e5239c543f1ca6fd255b45cea04a50cbe68563d5c
MD5 e5b598ac44a10133869029b57be41660
BLAKE2b-256 ebe03087bcee47ce19550e723aeac481539162329f1db604849a214da1e67eda

See more details on using hashes here.

Release history Release notifications | RSS feed

0.11.0

2 files

This release

0.10.0 This release

2 files

0.9.0

2 files

0.8.0

2 files

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