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

The pin is enforced, not just documented: scripts/check_python_sdk_generated.py regenerates into a temp directory and fails CI if the committed tree differs. Change the version in that script and in the recipe above together — they are the same pin, and the script is the half that CI reads.

This gate exists because the two drifted apart once already: the committed output had been produced by a different generator build than this README named, and regenerating with the documented version rewrote ~100 files and introduced an import (typing_extensions) that was not a declared dependency.

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.

Metadata

Release files for cloacina-client 0.11.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 cloacina-client 0.11.1
File Size Uploaded Provenance
cloacina_client-0.11.1.tar.gz 88.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cloacina-client 0.11.1
File Interpreter ABI Platform
cloacina_client-0.11.1-py3-none-any.whl Python 3 none any Details

Total release size: 303.0 kB

Release files / cloacina_client-0.11.1.tar.gz

Download URL cloacina_client-0.11.1.tar.gz
Size 88.1 kB
Tags Source
SHA-256 checksum
How to use checksums
984b531469093e598bd1c436ea779ab862b1d6e20fbd7bbc17965eea335c899f
BLAKE2b-256 checksum
How to use checksums
8d608aba902ab163ef612165bf0c1f874e3f34e9c8c189b586b574e8d0ac1d16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / cloacina_client-0.11.1-py3-none-any.whl

Download URL cloacina_client-0.11.1-py3-none-any.whl
Size 214.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2b28121abecd36b554d5d58f064397aaaf93cdc99e684e5a3be1d83cd7873b26
BLAKE2b-256 checksum
How to use checksums
606deeeb519a2a68c197067e40066f36fe2f671ca982c360611fb39e8d67f2fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for cloacina-client 0.11.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.

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