Skip to main content

kailash-client (Python)

Python client for kailash — a test-resource control plane that hands out isolated, short-lived infrastructure resources (PostgreSQL schemas, Elasticsearch indices, Redis databases, MinIO buckets, Hatchet tenants, MySQL databases, Chrome contexts) as slots acquired from a pool of registered instances.

The package ships two layers:

  • a fully generated API/client layer (kailash_client.generated, pydantic v2 models plus one typed API class per kailash endpoint), and
  • a thin hand-written facade, KailashClient, which is the recommended entry point.

Installation

pip install kailash-client

Requires Python 3.10+.

Quickstart

Point the client at a running kailash server (http://localhost:18080 is the default) and acquire a slot from the zero-dependency in-memory demo category (note: demo is disabled by default on a stock deployment — a ROOT user can enable it via POST /api/categories/demo/enable):

from kailash_client import AcquireRequest, KailashClient, Slot, SlotSpec
from kailash_client.generated.models import DemoSlotSpec

client = KailashClient("http://localhost:18080", auth=("user", "password"))

slot: Slot = client.slots.acquire(
    AcquireRequest(
        spec=SlotSpec(
            DemoSlotSpec(
                caller_app="my-app",
                caller_run="run-1",
                timeout_seconds=600,
            )
        )
    )
)
print(slot.slot_id, slot.endpoint)

# Release as soon as you are done — the TTL is only a safety net.
client.slots.release(slot.slot_id)

SlotSpec(...) wraps one concrete spec (polymorphic oneOf); every category has its own spec model, e.g. PgSlotSpec, RedisSlotSpec, EsSlotSpec.

Authentication

kailash requires authentication on all /api/* endpoints (Basic or Bearer):

  • KailashClient(base_url, auth=(username, password)) sends HTTP Basic on every request.
  • client.login(username, password) exchanges the credentials for a Bearer token (TTL 12h on the server) and uses it for subsequent requests; client.logout() revokes it and falls back to Basic (or clears the header if no Basic credentials were given).

Error handling

Server errors can be normalized to a structured triple (status, message, message_key) for i18n/branching:

from kailash_client import KailashApiError
from kailash_client.generated.exceptions import ApiException

try:
    client.slots.acquire(request)
except ApiException as e:
    err = KailashApiError.from_api_exception(e)
    print(err.status, err.message, err.message_key)

Timeouts and retries

The client does not impose its own timeouts or automatic retries — pass _request_timeout=... per call or configure the urllib3 pool on the generated Configuration. See the main README for the full auth model, error contract, and plugin/category documentation.

Other clients

The same API is available as Java, TypeScript, JavaScript, Rust, and Go clients.

Metadata

Release files for kailash-client 0.9.6

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

Source distribution (sdist)

Source distribution for kailash-client 0.9.6
File Size Uploaded Provenance Actions
kailash_client-0.9.6.tar.gz 46.4 kB Without provenance Details for kailash_client-0.9.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kailash-client 0.9.6
File Interpreter ABI Platform Actions
kailash_client-0.9.6-py3-none-any.whl Python 3 none any Details for kailash_client-0.9.6-py3-none-any.whl

Total release size: 172.9 kB

Release files / kailash_client-0.9.6.tar.gz

Download URL kailash_client-0.9.6.tar.gz
Size 46.4 kB
Tags Source
SHA-256 checksum
How to use checksums
05b861bf4f34b78c8911d578814600bf6d8a3b99011c5015e037d747065d255d
BLAKE2b-256 checksum
How to use checksums
8812145512c75ed3a16d4af2aa90c2f81afe66d19e99a3c489876b38326c9fdd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / kailash_client-0.9.6-py3-none-any.whl

Download URL kailash_client-0.9.6-py3-none-any.whl
Size 126.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dbaaff5d8be9e2235b77a398ecbb6b54f9d3aca6cae1b11746e608489c350039
BLAKE2b-256 checksum
How to use checksums
809dc39c8474bde6aa130b3b3a5107ba14ce73ccae96ca9bd05ca876fd866e1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for kailash-client 0.9.6

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