1"""Psyclone client for Python: talk to a running Psyclone system from outside it.
3Post messages into the system by **post name** and receive what its triggers send out by **trigger
4name**, over UDP, TCP or WebSocket, with CMSDK DataMessages (byte-identical to the C++ library, in the
5full or the packed form). Pure Python, standard library only; Python 3.8+ on any OS.
7 from psyclone_client import PsycloneClient, DataMessage
9 with PsycloneClient.websocket("ws://host:18600/phone", device="py-1") as psy:
10 psy.on_trigger("Playout", lambda m: print(m.get_string("Text")))
11 psy.post("AudioFrame", DataMessage().set_data("audio", b"..."))
12 reply = psy.request("Question", DataMessage().set_string("Text", "hi"), timeout=3)
14from .client
import DEVICE, KEEPALIVE, POST, REQUEST_ID, TRIGGER, Options, PackedMode, PsycloneClient
15from .datamessage
import DataMessage, Layout, PsyContext, PsyTime, PsyType, Raw, Time
16from .http
import PsycloneHttp, Reply
17from .remote_module
import ATTACHED, DETACHED, STOPPED, Auth, RemoteModule, RemoteModuleError, Trigger
18from .stats
import ConnectionStats
21__all__ = [
"PsycloneClient",
"RemoteModule",
"RemoteModuleError",
"Auth",
"Trigger",
"ATTACHED",
"STOPPED",
"DETACHED",
"Options",
"PackedMode",
"ConnectionStats",
"PsycloneHttp",
"Reply",
"DataMessage",
"PsyType",
"PsyContext",
22 "PsyTime",
"Time",
"Raw",
"Layout",
"POST",
"TRIGGER",
"DEVICE",
"REQUEST_ID",
"KEEPALIVE"]