CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
Loading...
Searching...
No Matches
__init__.py
Go to the documentation of this file.
1"""Psyclone client for Python: talk to a running Psyclone system from outside it.
2
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.
6
7 from psyclone_client import PsycloneClient, DataMessage
8
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)
13"""
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
19
20__version__ = "2.3.2"
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"]