Skip to main content

Python client for the Zendo motion-tracking WebSocket stream.

Project description

zendo-sdk (Python)

PyPI Python versions

Python client for the Zendo motion-tracking WebSocket stream. Connect to a running Zendo instance and get typed quaternion and landmark events — no byte-parsing, no port hunting.

The package is a thin layer over the Rust zendo-sdk crate (via PyO3), so decoding and the connection lifecycle are handled in Rust. It imports as zendo.

Install

pip install zendo-sdk

Wheels are published for Linux (x86_64, aarch64), macOS (Apple Silicon and Intel), and Windows (x86_64), on CPython 3.10 and newer.

Quickstart

The client is synchronous and blocking: iterating it waits for the next frame. This keeps it ergonomic in notebooks and scripts.

import zendo

with zendo.connect() as client:          # auto-discovers the port (5432-5435)
    print(f"connected on port {client.port}")
    for event in client:
        match event:
            case zendo.BodyQuaternions(frame):
                print("hips:", frame.hips.w, frame.hips.x, frame.hips.y, frame.hips.z)
            case zendo.BodyLandmarks(frame):
                print("nose:", frame.nose.x, frame.nose.y, frame.nose.z)
            case zendo.HandQuaternions(side, frame):
                print(side, "wrist:", frame.wrist.w)
            case zendo.HandLandmarks(side, frame):
                print(side, "thumb tip:", frame.thumb_tip.x, frame.thumb_tip.confidence)
            case zendo.BodyIsbAngles(frame):
                print("right elbow flexion:", frame.right_elbow_flexion)

Without structural pattern matching:

import zendo

with zendo.connect() as client:
    for event in client:
        if isinstance(event, zendo.BodyQuaternions):
            print(event.frame.hips)

Connecting

Function Behaviour
zendo.connect() Scans ports 5432-5435 on 127.0.0.1, connects to the first Zendo found.
zendo.connect_at(port) Connects to an explicit port on 127.0.0.1.
zendo.connect_url(url) Connects to an explicit ws://host:port URL.

To reach a Zendo on another machine, copy the address from Zendo's Settings: zendo.connect_url("ws://192.168.1.42:5432"). The stream is plain ws:// — unencrypted and unauthenticated — so only use it on a trusted network.

All three accept reconnect=True to transparently re-establish a dropped connection with exponential backoff:

client = zendo.connect(reconnect=True, base_delay_ms=250, max_retries=10)

Types

Events are immutable dataclasses. Frames expose one attribute per joint or landmark — frame.hips, frame.left_wrist, frame.thumb_tip — each a Quaternion (w, x, y, z) or Landmark (x, y, z, confidence). Frames are also iterable: for name, value in frame: ....

BodyIsbAnglesFrame instead exposes 21 scalar float attributes (in radians) — frame.neck_flexion, frame.right_elbow_flexion, etc. The shoulder plane_of_elevation fields are float('nan') when the shoulder is near neutral (gimbal singularity).

The package ships type information (py.typed) and is checked with ty and linted with ruff.

Offline decoding

zendo.decode_frame(data: bytes) decodes a single raw protocol frame into a typed event — handy for replaying captures or testing.

License

Licensed under either of Apache-2.0 or MIT at your option.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zendo_sdk-0.3.3.tar.gz (78.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

zendo_sdk-0.3.3-cp310-abi3-win_amd64.whl (396.5 kB view details)

Uploaded CPython 3.10+Windows x86-64

zendo_sdk-0.3.3-cp310-abi3-musllinux_1_2_x86_64.whl (767.5 kB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ x86-64

zendo_sdk-0.3.3-cp310-abi3-manylinux_2_28_x86_64.whl (562.1 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ x86-64

zendo_sdk-0.3.3-cp310-abi3-manylinux_2_28_aarch64.whl (563.4 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARM64

zendo_sdk-0.3.3-cp310-abi3-macosx_11_0_arm64.whl (500.7 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

zendo_sdk-0.3.3-cp310-abi3-macosx_10_12_x86_64.whl (505.7 kB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file zendo_sdk-0.3.3.tar.gz.

File metadata

  • Download URL: zendo_sdk-0.3.3.tar.gz
  • Upload date:
  • Size: 78.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for zendo_sdk-0.3.3.tar.gz
Algorithm Hash digest
SHA256 2d00fbb255b84278c0ae688a52224ef2fa20cd8e7e846a166a79b8d883f6269c
MD5 984fb00ac969199a078db527798247de
BLAKE2b-256 e0548fe1692ab66143f50dae417955a0ced1879d01ed6b2dd5a85ef80862b353

See more details on using hashes here.

Provenance

The following attestation bundles were made for zendo_sdk-0.3.3.tar.gz:

Publisher: publish-sdk.yml on akina-health/zendo-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zendo_sdk-0.3.3-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: zendo_sdk-0.3.3-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 396.5 kB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for zendo_sdk-0.3.3-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 e121ec07ffbda6e475083230219578a2e89a6a05d0f3836b8dba0bb827db509e
MD5 097d7cc36771c160806c51fc6e46f931
BLAKE2b-256 aa72ae486bc5a05b63362e34f03ddddc3b746ee300c8a89d0284a126966d01bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for zendo_sdk-0.3.3-cp310-abi3-win_amd64.whl:

Publisher: publish-sdk.yml on akina-health/zendo-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zendo_sdk-0.3.3-cp310-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for zendo_sdk-0.3.3-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 f7d54919786d6b5250c341d12baad2bba1345ba488352df72ba53eaf26428e0e
MD5 b86349f71ab9aa0087c5de5883d99d77
BLAKE2b-256 e48c35ee7c90fa7b7e0a356089809d9f677f20d6c148b98271b1d49d9250017b

See more details on using hashes here.

Provenance

The following attestation bundles were made for zendo_sdk-0.3.3-cp310-abi3-musllinux_1_2_x86_64.whl:

Publisher: publish-sdk.yml on akina-health/zendo-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zendo_sdk-0.3.3-cp310-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for zendo_sdk-0.3.3-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d4e3d9777d9102668fb500fdae0daea7a331a66b005e426435f7cfdaa5e759dc
MD5 616fb38e9049e45f629cef7b68588fa6
BLAKE2b-256 2496e87e7368435f3e294c83546474691822d653ced4d374b35158251e136120

See more details on using hashes here.

Provenance

The following attestation bundles were made for zendo_sdk-0.3.3-cp310-abi3-manylinux_2_28_x86_64.whl:

Publisher: publish-sdk.yml on akina-health/zendo-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zendo_sdk-0.3.3-cp310-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for zendo_sdk-0.3.3-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 5bbcd0b9574fa012a3f8a2b48cd7fa90746be4f754abe6831aaceb29acf4646a
MD5 16b05c65c05319f654aec747ce94d8e7
BLAKE2b-256 a9dca1f78035a7433318215ee7be1d679fae41f7f630a75de6a555f98a5ae901

See more details on using hashes here.

Provenance

The following attestation bundles were made for zendo_sdk-0.3.3-cp310-abi3-manylinux_2_28_aarch64.whl:

Publisher: publish-sdk.yml on akina-health/zendo-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zendo_sdk-0.3.3-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for zendo_sdk-0.3.3-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dec98636ba062ef8a05909ee53e5c7f24ece5eeb18c8e5c55bde186c8e0920a1
MD5 169ed2bb6658fc2f77d94e54871c470b
BLAKE2b-256 ca96b459bd123f7fbe64bfa503360368cc099559c8decf168b788d138635c37e

See more details on using hashes here.

Provenance

The following attestation bundles were made for zendo_sdk-0.3.3-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: publish-sdk.yml on akina-health/zendo-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zendo_sdk-0.3.3-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for zendo_sdk-0.3.3-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 adfc3463b3cd9e1c2c4c9271a6637c78b529a00128283eac3c3470d6f9dfd772
MD5 246a7bd9754ba50dd2ae65b4d7b87e65
BLAKE2b-256 9a447344afc8bfad25ddf1416cd9eec2f618c6bf26fdb285f27685478d4a1297

See more details on using hashes here.

Provenance

The following attestation bundles were made for zendo_sdk-0.3.3-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: publish-sdk.yml on akina-health/zendo-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page