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.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| kailash_client-0.9.7.tar.gz | 46.5 kB | Without provenance | Details for kailash_client-0.9.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| kailash_client-0.9.7-py3-none-any.whl | Python 3 | none | any | Details for kailash_client-0.9.7-py3-none-any.whl |
Total release size: 172.9 kB
Release files / kailash_client-0.9.7.tar.gz
| Download URL | kailash_client-0.9.7.tar.gz |
|---|---|
| Size | 46.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
268d26319b683becb9f1e1eb4ff38e22f7818941b34ec2c5827bb4b45d65ae5e
|
|
BLAKE2b-256 checksum How to use checksums |
36d12db91e048ca3f06a845b1b957cfbbba895f400e6f307357c4741ce94aaea
|
| 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.7-py3-none-any.whl
| Download URL | kailash_client-0.9.7-py3-none-any.whl |
|---|---|
| Size | 126.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bc2e642e59a6c4d28d1e22bd8b3c4673c0bedc61b2d5af12d268f33557d7788a
|
|
BLAKE2b-256 checksum How to use checksums |
120a28982bad757e0c677582abc975c378f07ef238b778f00bb33cd771ce99d7
|
| 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.7
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.