Skip to main content

wftnp

An asynchronous, typed Python client for WFTNP (Wahoo Direct Connect).

The library discovers endpoints, inspects services and characteristics, exchanges opaque characteristic bytes, and receives notifications. It manages connections and restores subscriptions after network interruptions. It does not interpret fitness metrics, control workouts, or depend on Home Assistant.

Requires Python 3.11 or newer. The core client has no runtime dependencies.

pip install wftnp
# Optional mDNS discovery:
pip install 'wftnp[discovery]'
import asyncio
from wftnp import Endpoint, WftnpClient


async def main():
    async with WftnpClient(Endpoint("trainer.local", 36866)) as client:
        for service in await client.discover_services():
            print(service.uuid)
            for characteristic in await client.discover_characteristics(service.uuid):
                print(characteristic.uuid, characteristic.properties)


asyncio.run(main())

See architecture and lifecycle for the behavioral contract, and examples for notification streaming and read-only hardware checks.

Notifications

from uuid import UUID


async def stream(client: WftnpClient, characteristic: UUID):
    async with await client.subscribe(characteristic) as subscription:
        async for notification in subscription:
            print(notification.connection_id, notification.value.hex())

Subscriptions recover across reconnects. Requests and writes are never replayed. Disconnected calls fail promptly; use await client.wait_ready() when recovery should be awaited. Notification buffers are bounded and report overflow explicitly. Values remain raw bytes: decoding speed, cadence, power, or treadmill metrics belongs in a fitness-profile layer above this library.

Discovery

from wftnp.discovery import discover


async def find_devices():
    for advertisement in await discover(timeout=3):
        print(advertisement.name, advertisement.endpoint)

Development

uv sync --all-extras
task check
task build

Tests use a local TCP simulator and require no hardware. Real-device checks are explicitly opted into and perform only discovery, reads, and notification subscriptions.

Protocol basis

WFTNP is a vendor-originated protocol with an unofficial public description: elfrances/wahoo-fitness-tnp. This implementation is independently written. It is not affiliated with Wahoo. Characteristic payload semantics belong to higher-level libraries.

Metadata

Release files for wftnp 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wftnp 0.1.1
File Size Uploaded
wftnp-0.1.1.tar.gz 58.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wftnp 0.1.1
File Interpreter ABI Platform
wftnp-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 77.2 kB

Release files / wftnp-0.1.1.tar.gz

Download URL wftnp-0.1.1.tar.gz
Size 58.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c82fbe72eeef42eb40acc635f4c8cb1363012af42c6781f777277cdca07578cf
BLAKE2b-256 checksum
How to use checksums
f8c7873a9290d3008068382df807a2d8f0885c7d7068749cab71c491a8dae375
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release files / wftnp-0.1.1-py3-none-any.whl

Download URL wftnp-0.1.1-py3-none-any.whl
Size 18.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fdcbe66f1166a27bf6447575dd0da0e9f5cd1678bfb38069cac520314ef54036
BLAKE2b-256 checksum
How to use checksums
c3be3638c8a5919e0b0ca182b906afe88be26b89a64542b1b76e48a336b9086e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.2

2 release files

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page