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.9.0.tar.gz (78.7 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.9.0-py3-none-any.whl (184.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for cloacina_client-0.9.0.tar.gz
Algorithm Hash digest
SHA256 b1c35e0dad0e326f41e24f2672e91f317ade564c1feeed3a8be367e8d218e4c2
MD5 ddaf608ccef4298f503da731442eb42e
BLAKE2b-256 2d21e7a1bc3c15201c1177d63060b77fd72a2adee1430976c59c9de8da693259

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cloacina_client-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 184.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cloacina_client-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 06f4ca89303ec610357d186f856147116257e1323178a1d3042cb81b57a08531
MD5 29c6b45e71d35be63f26772249f243d8
BLAKE2b-256 c079d382f0d8b8c36874a4cb34ada5938df82590c4baf08351052641bb81c0c8

See more details on using hashes here.

Release history Release notifications | RSS feed

0.11.0

2 files

0.10.0

2 files

This release

0.9.0 This release

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