Covers Engine 2.0.0
DartwicClient
Client for DARTWIC operations and common RAPID channel queries.
Constructor
Create a client around a new or existing TEMPEST connection.
def __init__(self, tempest_client: Optional[TempestClient] = None) -> None| Name | Description |
|---|---|
tempest_client | Existing TEMPEST client to reuse. A new client is created when omitted. |
Methods
connect
Connect to an engine and verify client compatibility.
def connect(self, ip: str = "127.0.0.1", port: int = 7000, password: str = "") -> TempestResponseParameters
| Name | Description |
|---|---|
ip | Engine host name or IP address. |
port | TEMPEST server port. |
password | Engine connection password. |
Returns
The TEMPEST connection response.
Raises
| Exception | When |
|---|---|
RuntimeError | The connected engine is older than the client’s minimum supported version. |
disconnect
Disconnect from the engine and return the TEMPEST response.
def disconnect(self) -> TempestResponseis_connected
Return local connection state; heartbeat failures clear it. This is not a network probe.
def is_connected(self) -> boolget_channels
Read a batch of live channel records, including explicit exists flags.
def get_channels(self, channels: Iterable[str]) -> Dict[str, Any]Parameters
| Name | Description |
|---|---|
channels | Nonempty sequence of flat channel keys, without pipes. |
Returns
Records keyed by channel name. The engine rounds these live values to three decimals.
query_channel
Read one field of a live channel; a missing channel or field raises KeyError.
def query_channel(self, channel: str, field: str = "value") -> AnyParameters
| Name | Description |
|---|---|
channel | Flat channel key, without pipes. |
field | Field to read, defaulting to value. |
Returns
The field value. Live numeric values are rounded by the engine to three decimals.
upsert_channel
Write a typed channel field subject to engine authority; does not take manual override.
def upsert_channel(self, channel: str, value: Any, field: str = "value") -> NoneParameters
| Name | Description |
|---|---|
channel | Flat channel key, without pipes. |
value | Numeric value or the selected metadata field’s JSON value. |
field | Field to write, defaulting to value. |
subscribe_telemetry
Bind raw TEMPEST telemetry locally and return an idempotent unsubscribe function.
def subscribe_telemetry(self, prefix: str, handler: Any) -> AnyParameters
| Name | Description |
|---|---|
prefix | Topic prefix to match. This does not enable engine channel streaming. |
handler | Callback receiving the wire telemetry dictionary and unmatched topic suffix. Runs on the receive thread. |
Returns
A callable removing this binding. Keep callbacks short; exceptions are logged and isolated.
subscribe_channel
Enable a channel stream, deliver its initial snapshot, and return an unsubscribe function.
def subscribe_channel(self, channel: str, handler: Any) -> AnyParameters
| Name | Description |
|---|---|
channel | Exact flat channel name; similarly prefixed names are not dispatched. |
handler | Callback receiving the channel snapshot dictionary. Initial delivery occurs on the caller; updates on the telemetry thread. |
Returns
Idempotent unsubscribe callable. Disconnect removes server subscriptions; subscribe again after reconnecting.
operation
Call a TEMPEST operation.
def operation(self, name: str, payload: Optional[Dict[str, Any]] = None, timeout_ms: int = 5000) -> TempestResponseParameters
| Name | Description |
|---|---|
name | Exact operation name. |
payload | Operation-specific request payload. |
timeout_ms | Client-side timeout in milliseconds. |
Returns
The TEMPEST operation response.
search_channel_dataframes
Search channel dataframes and normalize results by dataframe name.
def search_channel_dataframes(self, query: str = "", limit: int = 100) -> Dict[str, Any]Parameters
| Name | Description |
|---|---|
query | Text used to filter dataframe names. |
limit | Maximum number of matches. |
Returns
The normalized query and matching dataframe records.
get_channel_keys
Search RAPID channel keys.
def get_channel_keys(self, query: str = "", limit: int = 1000) -> Dict[str, Any]Parameters
| Name | Description |
|---|---|
query | Text used to filter channel keys. |
limit | Maximum number of matches. |
Returns
The normalized query and matching channel keys.
query_channel_range
Query recorded values for one or more channel series.
def query_channel_range(
self,
series: Iterable[str],
from_timestamp: Optional[int] = None,
to_timestamp: Optional[int] = None,
data_frame: str = "",
bucket_count: Optional[int] = None,
timeout_ms: int = 10000,
bucket_mode: str = "average",
) -> Dict[str, Any]Parameters
| Name | Description |
|---|---|
series | Channel references to query. |
from_timestamp | Inclusive lower timestamp bound in nanoseconds. |
to_timestamp | Inclusive upper timestamp bound in nanoseconds. |
data_frame | Optional dataframe constraint. |
bucket_count | Optional number of aggregation buckets. |
timeout_ms | Client-side timeout in milliseconds. |
bucket_mode | average or extrema; meaningful when bucket_count is positive. |
Returns
Channel points and aggregate query statistics.