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.2.0.tar.gz (76.5 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.2.0-cp310-abi3-win_amd64.whl (396.0 kB view details)

Uploaded CPython 3.10+Windows x86-64

zendo_sdk-0.2.0-cp310-abi3-musllinux_1_2_x86_64.whl (767.0 kB view details)

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

zendo_sdk-0.2.0-cp310-abi3-manylinux_2_28_x86_64.whl (561.7 kB view details)

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

zendo_sdk-0.2.0-cp310-abi3-manylinux_2_28_aarch64.whl (562.8 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARM64

zendo_sdk-0.2.0-cp310-abi3-macosx_11_0_arm64.whl (500.2 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

zendo_sdk-0.2.0-cp310-abi3-macosx_10_12_x86_64.whl (505.1 kB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: zendo_sdk-0.2.0.tar.gz
  • Upload date:
  • Size: 76.5 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.2.0.tar.gz
Algorithm Hash digest
SHA256 fdcdc1ee9354764051fd1937d1f6f9005eb1a31445cf5dc8ba9d25f4f2a926f5
MD5 b16b85a996a93fcad46bbd796f41980f
BLAKE2b-256 df97adccef26fd002c636d544a02a38ec0e44e1dedf3ccd45f70c73015d06888

See more details on using hashes here.

Provenance

The following attestation bundles were made for zendo_sdk-0.2.0.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.2.0-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: zendo_sdk-0.2.0-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 396.0 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.2.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 aa05f1ebe1e8892d393978adc58cf5f69edf97987ef7d05b58bd8fd21b95a4e2
MD5 4337b329e4958bb8bc4f5f68d2bb1cff
BLAKE2b-256 8906337406334eb85a3a713920ad4ddbb7fa870f841dd53f10edbdf6dcfaa40d

See more details on using hashes here.

Provenance

The following attestation bundles were made for zendo_sdk-0.2.0-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.2.0-cp310-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for zendo_sdk-0.2.0-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 caa2204b9575999ea050f40a99b2347bae9694f36651aaa1a699d16fd2f3c56b
MD5 64037689ae9a28eb06f9917c4c902195
BLAKE2b-256 d1de6df2843493f9b0efa0333b78c6193f48fe5ae0b4d5f9d000f888a63509ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for zendo_sdk-0.2.0-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.2.0-cp310-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for zendo_sdk-0.2.0-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9ed51f57e3c0a5e6c08b32e8487a276fade8138efe62a2628bfbe3f0cfec4f7f
MD5 3e606700bcc5efe89d6cd81831763ac4
BLAKE2b-256 ffc890c20413df07b4df1b5f356f335490683b3b404cd666ae1fdfce7735c3e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for zendo_sdk-0.2.0-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.2.0-cp310-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for zendo_sdk-0.2.0-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 ed555ad4c51bf050da227d4e235589940cc045dd758f8cbd0702a9f2826e371e
MD5 15e962385fa2db700d406e7200014948
BLAKE2b-256 a4d0c4ace4bb9b2417980bd5ff1755e847e403b338a6bd94c1416fd776aeff42

See more details on using hashes here.

Provenance

The following attestation bundles were made for zendo_sdk-0.2.0-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.2.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for zendo_sdk-0.2.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 be9b3327a33525fd2850866a103d7f6a6df5ed77fe8a6d479e767de07a1b4987
MD5 daf4c8f350b5e4f78ddd08cbf099a3c0
BLAKE2b-256 1c90456176b1ac27abe37d0f1d4245c26164a2e8e6d8c3bbc5486ea095f58229

See more details on using hashes here.

Provenance

The following attestation bundles were made for zendo_sdk-0.2.0-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.2.0-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for zendo_sdk-0.2.0-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0620835d0094f8775d10633bd1c54c155e48658ca66e30b10129297a3305ef7d
MD5 d5d2a2fa2d1a2ed2cebe874d47705478
BLAKE2b-256 6d66b520d0b10db22d6a5a6f38ceae3229d4eb255f2b8a885f31f59e195c2f17

See more details on using hashes here.

Provenance

The following attestation bundles were made for zendo_sdk-0.2.0-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