Connector
Python
Run Python on live and recorded data
- Category
- Tools
- Kind
- tool
- Capabilities
- EngineOperations
- Runs on
- Linux x64Linux ARM64macOS Apple siliconmacOS IntelWindows x64
Run Python code from Phloem. The agent and Trellis can evaluate expressions and run snippets to process signals, compute values or drive custom logic.
What you get
- Operations —
eval(run an expression), plus a connection test. - Each call runs in a fresh
python -cprocess. Imports and variables do not carry over between calls.
Setup
- Install the connector from the Connectors tab and open its page.
- Point it at your Python environment, then press Test to confirm.
Computed channels
A computed channel runs your function over a window of a signal and publishes the result as a new channel. Your function gets one window:
def my_metric(win):
# win["t_us"] — sample times, microseconds since 1970-01-01 UTC
# win["value"] — the sample values, same order
return max(win["value"]) - min(win["value"])
Return one number, or a dict of names to numbers for several outputs. Times are microseconds; divide by 1,000,000 for seconds.
Notes
- Put everything one computation needs, imports included, in one snippet.
#Connection fields
Every field the Add input form shows for this connector.
| Field | Type | Required | Default |
|---|---|---|---|
Python interpreter path/usr/bin/python3 | Text | — | — |
Updated