Python SDK
Cross-platform BLE host SDK for macOS, Windows, and Linux. Pair in the OS first, then connect from Python.
Package
| PyPI | tap-python-sdk |
|---|---|
| Source | TapWithUs/tap-python-sdk |
| Docs | tapwithus.github.io/tap-python-sdk |
| License | MIT |
| Status | Beta · Python ≥ 3.9 |
| Import | tapsdk |
Install
pip install tap-python-sdkPlatforms: 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.
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.
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.