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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kabaret_ipc-1.0.0.tar.gz (25.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kabaret_ipc-1.0.0-py3-none-any.whl (28.4 kB view details)

Uploaded Python 3

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

Hashes for kabaret_ipc-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e180841c8a6a34734d912a5aca06907a8bd31871e8125a92b9032a36a29bc96b
MD5 a81dc1aa6eae06fbb2b97346949972f4
BLAKE2b-256 379f2204bc10fb5c3425f7fb63cd9ab32c7d9be85fd55545111ca76363e2aa60

See more details on using hashes here.

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

Hashes for kabaret_ipc-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 23217b181e9670c0ef0483c42e3b639a56bad866c1684051a40708d7bb751b77
MD5 c65fa7ef8fe7d914dc3a51d210948216
BLAKE2b-256 fc7a2a10203e56c3d47852321ebd543c02abb342fca83803b919c166766c71be

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 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