Clients

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
NameDescription
tempest_clientExisting 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 = "") -> TempestResponse

Parameters

NameDescription
ipEngine host name or IP address.
portTEMPEST server port.
passwordEngine connection password.

Returns

The TEMPEST connection response.

Raises

ExceptionWhen
RuntimeErrorThe connected engine is older than the client’s minimum supported version.

disconnect

Disconnect from the engine and return the TEMPEST response.

def disconnect(self) -> TempestResponse

is_connected

Return local connection state; heartbeat failures clear it. This is not a network probe.

def is_connected(self) -> bool

get_channels

Read a batch of live channel records, including explicit exists flags.

def get_channels(self, channels: Iterable[str]) -> Dict[str, Any]

Parameters

NameDescription
channelsNonempty 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") -> Any

Parameters

NameDescription
channelFlat channel key, without pipes.
fieldField 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") -> None

Parameters

NameDescription
channelFlat channel key, without pipes.
valueNumeric value or the selected metadata field’s JSON value.
fieldField 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) -> Any

Parameters

NameDescription
prefixTopic prefix to match. This does not enable engine channel streaming.
handlerCallback 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) -> Any

Parameters

NameDescription
channelExact flat channel name; similarly prefixed names are not dispatched.
handlerCallback 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) -> TempestResponse

Parameters

NameDescription
nameExact operation name.
payloadOperation-specific request payload.
timeout_msClient-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

NameDescription
queryText used to filter dataframe names.
limitMaximum 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

NameDescription
queryText used to filter channel keys.
limitMaximum 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

NameDescription
seriesChannel references to query.
from_timestampInclusive lower timestamp bound in nanoseconds.
to_timestampInclusive upper timestamp bound in nanoseconds.
data_frameOptional dataframe constraint.
bucket_countOptional number of aggregation buckets.
timeout_msClient-side timeout in milliseconds.
bucket_modeaverage or extrema; meaningful when bucket_count is positive.

Returns

Channel points and aggregate query statistics.