TAP

Python SDK

Cross-platform BLE host SDK for macOS, Windows, and Linux. Pair in the OS first, then connect from Python.

  1. Package
  2. Install
  3. Hello Tap
  4. Modes
  5. Events
  6. Spatial Control
  7. Beta notes

Package

PyPItap-python-sdk
SourceTapWithUs/tap-python-sdk
Docstapwithus.github.io/tap-python-sdk
LicenseMIT
StatusBeta · Python ≥ 3.9
Importtapsdk

Install

terminal
pip install tap-python-sdk

Platforms: macOS (CoreBluetooth), Windows 10+ (Bleak/WinRT), Linux (BlueZ). Pair Tap with the OS before running your script.

Hello Tap

v1 TapSDK (classic Tap Strap). Pair in OS Bluetooth first, then connect, start, and switch to Controller mode — Text/HID sends no tap callbacks.

hello_tap.py
import asyncio
from tapsdk import InputModeController, TapSDK, connect


def on_tap(identifier, tapcode):
    # tapcode is int 1..31 — bit0=thumb … bit4=pinky
    print(f"{identifier} tapped {tapcode} (0b{int(tapcode):05b})")


async def main():
    # Pair in OS Bluetooth settings first — do not expect a cold unpaired scan.
    sdk = await connect()
    assert isinstance(sdk, TapSDK), (
        "Expected v1 TapSDK (classic Tap Strap). "
        "If connect() returned TapSDK2, see the v2 notes in published docs."
    )

    sdk.register_tap_events(on_tap)
    await sdk.start()
    await sdk.set_input_mode(InputModeController())

    print("Controller mode on. Waiting for taps… (Ctrl+C to quit)")
    await asyncio.Event().wait()


if __name__ == "__main__":
    asyncio.run(main())

Register callbacks, await sdk.start(), then await sdk.set_input_mode(InputModeController()) — same sequence as Getting started.

Modes

Recent releases use typed modes such as InputModeText, InputModeController, InputModeControllerText, and InputModeRaw (replacing older stringly TapInputMode("…")). Pin a version and check the published reference for setters on that release — the package is beta.

NOTESame rule as every platform: Text mode = HID keyboard, no SDK tap events. Controller mode is required for combinations.

Events

Register handlers for tap, mouse, air gesture, raw / IMU packets, and connect / disconnect. Exact method names live in the package reference; the Hello Tap example above is the minimal tap path.

Spatial Control

TapXR Spatial Control needs authorized builds. Request access.

Beta notes

  • APIs can change between PyPI releases — pin versions.
  • Prefer the published docs when this page and a release diverge.
  • BLE stacks differ (BlueZ / CoreBluetooth / Bleak). Re-pair if connect flaps.