Liking cljdoc? Tell your friends :D

hive-tmux.python.bridge

Low-level Python bridge utilities via libpython-clj.

Copy-adapted from hive-agent-bridge.python.bridge — same pattern: lazy init, conda env detection, thin wrappers.

No asyncio needed: libtmux operations are synchronous.

Preflight status is a closed ADT (defadt PreflightStatus) with exhaustive adt-case matching for remediation hints.

Low-level Python bridge utilities via libpython-clj.

Copy-adapted from hive-agent-bridge.python.bridge — same pattern:
lazy init, conda env detection, thin wrappers.

No asyncio needed: libtmux operations are synchronous.

Preflight status is a closed ADT (defadt PreflightStatus) with
exhaustive adt-case matching for remediation hints.
raw docstring

->preflight-statusclj

(->preflight-status kw__1708__auto__)

Coerce a keyword to a PreflightStatus variant (no data fields). Returns nil if keyword is not a valid variant.

Coerce a keyword to a PreflightStatus variant (no data fields).
Returns nil if keyword is not a valid variant.
sourceraw docstring

available?clj

(available?)
(available? opts)

Returns true if all preflight checks pass.

Returns true if all preflight checks pass.
sourceraw docstring

default-python-executableclj

(default-python-executable)

Resolve the Python interpreter for libpython-clj.

Precedence:

  1. hive-di PythonConfig/:python-executable (env-driven)
  2. HOME-relative conda env auto-detection
  3. nil — caller lets libpython-clj autodetect.
Resolve the Python interpreter for libpython-clj.

Precedence:
  1. hive-di `PythonConfig/:python-executable` (env-driven)
  2. HOME-relative conda env auto-detection
  3. nil — caller lets libpython-clj autodetect.
sourceraw docstring

ensure-python!clj

(ensure-python!)
(ensure-python! opts)

Ensure Python is initialized and libtmux is importable. Idempotent.

Returns: true if Python is ready with libtmux available, false otherwise.

Ensure Python is initialized and libtmux is importable. Idempotent.

Returns:
  true if Python is ready with libtmux available, false otherwise.
sourceraw docstring

preflight-statusclj

(preflight-status variant-kw__1705__auto__)
(preflight-status variant-kw__1705__auto__ data__1706__auto__)

Construct a PreflightStatus variant. (preflight-status variant-keyword) for enum variants (preflight-status variant-keyword data-map) for data variants

Throws ex-info for unknown variants.

Construct a PreflightStatus variant.
(preflight-status variant-keyword) for enum variants
(preflight-status variant-keyword data-map) for data variants

Throws ex-info for unknown variants.
sourceraw docstring

preflight-status?clj

(preflight-status? x__1707__auto__)

True if x is a PreflightStatus ADT value.

True if x is a PreflightStatus ADT value.
sourceraw docstring

PreflightStatusclj

Closed set of preflight check outcomes. Each variant maps to a distinct failure mode with actionable remediation.

Closed set of preflight check outcomes.
Each variant maps to a distinct failure mode with actionable remediation.
sourceraw docstring

PreflightStatusMalliclj

Malli :multi schema (dispatch :adt/variant) for PreflightStatus — generator-capable and EDN-safe wherever pred-sym->malli covers the declared field predicates.

Malli :multi schema (dispatch :adt/variant) for PreflightStatus — generator-capable and EDN-safe wherever pred-sym->malli covers the declared field predicates.
sourceraw docstring

py->cljclj

(py->clj py-obj)

Convert a Python collection to Clojure-iterable while preserving Python object types. Uses as-jvm (not ->jvm) to avoid deep conversion that strips Python type info from list elements (e.g. libtmux Pane objects).

Convert a Python collection to Clojure-iterable while preserving
Python object types. Uses as-jvm (not ->jvm) to avoid deep conversion
that strips Python type info from list elements (e.g. libtmux Pane objects).
sourceraw docstring

py-attrclj

(py-attr obj attr)

Get a Python object attribute.

Returns attribute value or nil on failure.

Get a Python object attribute.

Returns attribute value or nil on failure.
sourceraw docstring

py-callclj

(py-call obj method & args)

Call a Python method on an object. Supports kwargs via keyword args (e.g. :window_name "foo"). Uses call-attr-kw to properly separate positional and keyword arguments.

Returns method return value. Throws ExceptionInfo on failure.

Call a Python method on an object.
Supports kwargs via keyword args (e.g. :window_name "foo").
Uses call-attr-kw to properly separate positional and keyword arguments.

Returns method return value.
Throws ExceptionInfo on failure.
sourceraw docstring

py-dictclj

(py-dict m)

Create a Python dict from a Clojure map.

Create a Python dict from a Clojure map.
sourceraw docstring

py-importclj

(py-import module-name)

Safely import a Python module. Patches IO encoding before import (idempotent) for libtmux compat.

Returns: Python module object or nil if unavailable.

Safely import a Python module.
Patches IO encoding before import (idempotent) for libtmux compat.

Returns:
  Python module object or nil if unavailable.
sourceraw docstring

remediation-hintclj

(remediation-hint status)

Get user-facing remediation message for a preflight status ADT value. Exhaustive matching — compile-time safety via adt-case.

Get user-facing remediation message for a preflight status ADT value.
Exhaustive matching — compile-time safety via adt-case.
sourceraw docstring

reset-python!clj

(reset-python!)

Reset initialization state. For testing.

Reset initialization state. For testing.
sourceraw docstring

run-preflightclj

(run-preflight)
(run-preflight opts)

Run staged preflight checks. Returns PreflightStatus ADT value.

Check order (fail-fast):

  1. libpython-clj on classpath?
  2. Python executable exists?
  3. libpython-clj initializes?
  4. libtmux importable?
  5. tmux binary on PATH?

Each stage fails fast with a distinct ADT variant. Use remediation-hint for user-facing install instructions.

Run staged preflight checks. Returns PreflightStatus ADT value.

Check order (fail-fast):
  1. libpython-clj on classpath?
  2. Python executable exists?
  3. libpython-clj initializes?
  4. libtmux importable?
  5. tmux binary on PATH?

Each stage fails fast with a distinct ADT variant.
Use `remediation-hint` for user-facing install instructions.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close