kabaret.ipc
A plugin that packs a local FastAPI server, so any external tool such as DCCs, production trackers, etc. can talk to any Kabaret session.
Installation
uv add kabaret.ipc
Add the package to your existing virtual environment, and Kabaret loads the plugin entry point automatically. Requires Python 3.10 or newer.
Quick start
The server writes where it listens and how to authenticate in ~/.kabaret/ipc/server.json:
{"host": "127.0.0.1", "port": 51234, "token": "...", "pid": 12345}
The OS picks the port at each start, so you need to read that file to find the server. The token goes in an Authorization: Bearer <token> header on every request.
import json
from pathlib import Path
import requests
info = json.loads((Path.home() / ".kabaret" / "ipc" / "server.json").read_text())
response = requests.post(
f"http://{info['host']}:{info['port']}/cmds/Flow/resolve_path",
headers={"Authorization": f"Bearer {info['token']}"},
json={"kwargs": {"oid": "/my_project/films"}},
)
print(response.json()["result"])
Usage
The first Kabaret session to start spawns the server on an open port, if none is already running. Every session then connects to it through a websocket.
The server stays up as long as one session is connected. When the last one disconnects, a 30sec cooldown starts and shuts the process down, unless a session shows up in the meantime.
If the server crashes or is closed by accident, sessions lose their websocket and try to relaunch it, retrying every two seconds.
Each run writes what it logs to its own file, ~/.kabaret/ipc/logs/ipc-{date}.log, alongside the console output. Only the five most recent are kept.
Routes
The full schema is served by FastAPI at http://{host}:{port}/docs.
GET-/sessions:- Returns the active sessions, keyed by session uid: their name, the cluster used and, for GUI sessions, the current oid of the active view.
POST-/cmds/{actor_name}/{cmd_name}- A single route to use any command from any loaded Actor, i.e.
session.cmds.<actor_name>.<cmd_name>(*args, **kwargs). - Body:
{"args": [...], "kwargs": {...}}, needed only if the command takes arguments. session_uidis a query parameter. If it is left out and only one session is running, the server automatically uses it.- Returns
{"result": ...}, or an error below.
- A single route to use any command from any loaded Actor, i.e.
| Status | Cause |
|---|---|
| 400 | several sessions are connected and no session_uid was given |
| 401 | missing or invalid token |
| 404 | unknown actor or command |
| 422 | arguments don't match the command signature |
| 500 | the command raised |
| 504 | the session did not reply within 10sec |
/ws/{session_uid} is the websocket Kabaret sessions register on. It is internal: external tools use the HTTP routes.
Security
So that only trusted processes can reach it, the server generates a token and stores it in ~/.kabaret/ipc/server.json.
Any utility needs to read that file to know how to use the local server.
The server only listens on 127.0.0.1 and the token is regenerated at each server start.
Resources
Support
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kabaret_ipc-1.0.0.tar.gz.
File metadata
- Download URL: kabaret_ipc-1.0.0.tar.gz
- Upload date:
- Size: 25.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e180841c8a6a34734d912a5aca06907a8bd31871e8125a92b9032a36a29bc96b
|
|
| MD5 |
a81dc1aa6eae06fbb2b97346949972f4
|
|
| BLAKE2b-256 |
379f2204bc10fb5c3425f7fb63cd9ab32c7d9be85fd55545111ca76363e2aa60
|
File details
Details for the file kabaret_ipc-1.0.0-py3-none-any.whl.
File metadata
- Download URL: kabaret_ipc-1.0.0-py3-none-any.whl
- Upload date:
- Size: 28.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23217b181e9670c0ef0483c42e3b639a56bad866c1684051a40708d7bb751b77
|
|
| MD5 |
c65fa7ef8fe7d914dc3a51d210948216
|
|
| BLAKE2b-256 |
fc7a2a10203e56c3d47852321ebd543c02abb342fca83803b919c166766c71be
|