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.3

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.3
File Size Uploaded Provenance Actions
kailash_client-0.9.3.tar.gz 46.1 kB Without provenance Details for kailash_client-0.9.3.tar.gz

Built distribution (wheel)

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

Total release size: 171.4 kB

Release files / kailash_client-0.9.3.tar.gz

Download URL kailash_client-0.9.3.tar.gz
Size 46.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d3a1bdd135a1f8114c91232b28883cad6222ada83fd5cdac7782562e7da2c09c
BLAKE2b-256 checksum
How to use checksums
d7dff5ac44ca828fdc9223e2c13b289f604ea9cbb447b87463e85726e9879569
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.3-py3-none-any.whl

Download URL kailash_client-0.9.3-py3-none-any.whl
Size 125.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3b3a767ac714c02a19b9884a9840bf5e1babb44b74b0bc11807c9056defc8860
BLAKE2b-256 checksum
How to use checksums
58c3265142b14ea13903ca125a44d05d82860fc7cf83ed270cb4be7e44b68602
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.3

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