Skip to content
Trigora
Start building →

Python client

Package: trigora-client. Import: trigora_client.

A token selects Cloud (TRIGORA_API_BASE_URL or https://api.trigora.dev). Otherwise the client uses TRIGORA_RUNTIME_URL or http://127.0.0.1:3477.

from trigora_client import Client, TrigoraError, start
def start(program_id: str, input: Any | None = None, *, url: str | None = None, token: str | None = None) -> ExecutionHandle
Client(url=None, token=None, project_id=None)
client.whoami()
client.deploy(body)
client.projects.list() / client.projects.create(body)
client.programs.list(*, limit=None, cursor=None)
client.programs.get(program_id)
client.programs.versions(program_id, *, limit=None, cursor=None)
client.executions.list(*, limit=None, cursor=None)
client.executions.start(program_id, input=None)

programs.list, programs.versions, and executions.list take limit and cursor. projects.list does not.

token defaults to TRIGORA_TOKEN when set.

handle.id
handle.send(name, payload=None)
handle.cancel()
handle.result(poll_seconds=0.05)

result polls GET /v1/executions/{id}. completed returns the result. failed and cancelled raise TrigoraError.

TrigoraError has status and code.