PYPI PACKAGE AUDIT v2.3.1 Verbesserungsbedarf

psyclone-client

Client für Psyclone-Systeme: Veröffentlichen von Nachrichten nach Postnamen und Empfangen von Triggern über UDP, TCP oder WebSocket (CMSDK DataMessage, reines Python)

PyPkgScore psyclone-client
Methodik & Kriterien ♥ Donate
505 / 1000
Schnellinstallation
pip install psyclone-client
1. Governance
50/200
2. PEP-Metadaten
200/200
3. Sicherheit
100/200
4. Doku & SEO
155/200
5. CI-Engineering
0/200
📣 Prüfung teilen: Teilen Sie diesen Bericht und die Vorschau in der aktuellen Sprache
Advertisement
PYPI-TELEMETRIE

Downloads & Community-Verbreitung

Letzte 30 Tage (ohne Spiegelserver)
Letzte 7 Tage
187
Letzte 30 Tage
187
Gesamt (180 Tage)
187
Metrik / Ökosystem Status / Wert Quelle
Downloads (30d / 180d) — PyPI Stats (without mirrors)
Trusted Publishing (PEP 740) ✕ Not detected PyPI Integrity / Sigstore
Django Packages — djangopackages.org
PyTech / PyPkgScore 505 / 1000 PyPkgScore Engine

Gesundheits- & Engineering-Analyse (5 Säulen)

1. Governance & Community50 / 200 ▾
LICENSE✓ 50 pts
SECURITY.md✕ 0 pts
CONTRIBUTING.md✕ 0 pts
CODE_OF_CONDUCT.md✕ 0 pts
2. PEP-Metadaten & Paketierung200 / 200 ▾
Wheel (.whl)✓ 50 pts
pyproject.toml✓ 50 pts
Project URLs✓ 50 pts
Trove Classifiers✓ 50 pts
3. Sicherheit & Lieferkette100 / 200 ▾
Null CVEs (OSV)✓ 60 pts
Trusted Publishing (OIDC)✕ 0 pts
Snyk / Audit Link✓ 40 pts
HTTPS-Repository✕ 0 pts
4. Dokumentation, SEO & Ökosystem155 / 200 ▾
Strukturierte README✓ 60 pts
Read the Docs✓ 50 pts
Django Packages✕ 0 pts
Webseite / Fachartikel✓ 45 pts
5. Engineering, CI & Qualität0 / 200 ▾
Automatisierte Tests✕ 0 pts
GitHub Actions CI✕ 0 pts
CHANGELOG.md✕ 0 pts
Env & Lockfile (uv/rye/poetry/pdm/hatch)✕ 0 pts
Advertisement
README & DOCS

Offizielle Dokumentation & Nutzungsleitfaden — psyclone-client

PyPI Metadata v2.3.1
Vollständige Originaldokumentation anzeigen (Englisches README) ▾

psyclone-client (Python)

Talk to a running Psyclone system from outside it: post messages into the system by post name and receive what its triggers send out by trigger name, over UDP, TCP or WebSocket. Messages are CMSDK DataMessages, byte-identical with the C++ library (full or packed form). Pure Python, standard library only: one wheel for Python 3.8+ on every OS.

pip install psyclone-client
from psyclone_client import PsycloneClient, DataMessage

with PsycloneClient.websocket("ws://host:18600/phone", device="py-1") as psy:   # or .udp(host, port), .tcp(...)
    psy.on_trigger("Playout", lambda m: print("got", m.get_data("audio")))      # pushed by the system
    psy.post("AudioFrame", DataMessage().set_data("audio", b"..."))             # into the system
    reply = psy.request("Question", DataMessage().set_string("Text", "hi"), timeout=3)   # or None

The service it talks to (any Psyclone 2.3+ system):

<service name="Phone">
  <post name="AudioFrame" type="Mimir.Audio.Frame"/>
  <trigger name="Playout" type="Mimir.Playout.Chunk"/>
</service>
<interface name="PhoneTCP" port="18600" protocol="HTTP" service="Phone"/>           <!-- HTTP + WebSocket -->
<interface name="PhoneUDP" port="18600" ip="UDP" protocol="Message" service="Phone"/>

DataMessage

m = DataMessage().set_string("Name", "x").set_int("N", 42).set_double("Gain", 0.7).set_data("pcm", b"\0\1")
m["Other"] = 5                     # by Python type: str, int, float, bytes, DataMessage
m.to_bytes(); m.to_packed_bytes()  # the two wire forms
DataMessage.from_bytes(wire)       # either form

setString/getInt/getBytes/fromBytes... (the names of the C++ binding cmsdk3) work too, so code moves between the two. Header fields are attributes (time, serial, type, tag, ...).

Behaviour

  • post(name, msg) sets PsyPost (and PsyDevice) on msg and sends it; False when the pipe is down (nothing is queued; reliability belongs in the modules, as with every Psyclone service).
  • Received messages go to the on_trigger(name, handler) handlers by their PsyTrigger, then to on_any_message. Handlers run on the reader thread; pass callback=loop.call_soon_threadsafe (or any callable that runs a function) to move them, e.g. into asyncio.
  • request() / request_async() add PsyClientRequestID and wait for the reply carrying it back. A responder that copies the request (the built-in Simple crank) does; one that builds a new message must copy PsyClientRequestID and PsyServiceConnection.
  • TCP and WebSocket reconnect by themselves (0.5 s doubling to 10 s, on_state_changed); WebSocket pings every 20 s. A UDP service learns a peer's address from its first datagram; with device set it follows the peer across address changes.
  • packed=True sends the packed form (about 3x less overhead); Psyclone answers in the form a peer used.
  • WebSocket text frames: send_text(), on_text(handler).
  • PsycloneHttp(base_url).request(path, post, fields) for a service's HTTP interface.

Not to be confused with cmsdk3, the C++ binding that runs Python cranks inside Psyclone; this package is for programs outside it. Licence: BSD with the CADIA clause (CMSDK).

Tests

python3 -m unittest discover -s tests        # codec conformance (C++ golden messages) + local transports
# live, against bin/<arch>/Psyclone spec=CMSDK/tools/client-test.xml port=18700:
PSYCLONE_LIVE=127.0.0.1 python3 -m unittest tests.test_client