Skip to main content

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_uid is 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.
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

Kabaret IPC Blender Bridge

Support

Discord server

Release files for kabaret.ipc 1.0.0

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

Source distribution (sdist)

Source distribution for kabaret.ipc 1.0.0
File Size Uploaded
kabaret_ipc-1.0.0.tar.gz 25.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kabaret.ipc 1.0.0
File Interpreter ABI Platform
kabaret_ipc-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size:53.7 kB

Release files / kabaret_ipc-1.0.0.tar.gz

Download URL kabaret_ipc-1.0.0.tar.gz
Size 25.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e180841c8a6a34734d912a5aca06907a8bd31871e8125a92b9032a36a29bc96b
BLAKE2b-256 checksum
How to use checksums
379f2204bc10fb5c3425f7fb63cd9ab32c7d9be85fd55545111ca76363e2aa60
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / kabaret_ipc-1.0.0-py3-none-any.whl

Download URL kabaret_ipc-1.0.0-py3-none-any.whl
Size 28.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23217b181e9670c0ef0483c42e3b639a56bad866c1684051a40708d7bb751b77
BLAKE2b-256 checksum
How to use checksums
fc7a2a10203e56c3d47852321ebd543c02abb342fca83803b919c166766c71be
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

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