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.

For the single serial hardware lane, copy hardware.example.toml to .hardware.toml, fill in the device endpoints, and run task test:hardware. The configuration and JUnit report are gitignored. Normal tests and hosted CI never connect to equipment. See hardware validation for scope and results.

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.2

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.2
File Size Uploaded
wftnp-0.1.2.tar.gz 65.2 kB Details

Built distribution (wheel)

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

Total release size: 84.1 kB

Release files / wftnp-0.1.2.tar.gz

Download URL wftnp-0.1.2.tar.gz
Size 65.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ce9b36a0e3bb678f05fe8c1e910062c0acae7fad256b95225ad0a955ac4fa710
BLAKE2b-256 checksum
How to use checksums
a5e88aa694aaeeb399c872ce60323672b004d7b2faa8d5a3787bb593cbb6824e
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.2-py3-none-any.whl

Download URL wftnp-0.1.2-py3-none-any.whl
Size 18.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f1fde779f0ee378be4faeccda434590a8e78cc374c3f16b607c143e44abd4c1f
BLAKE2b-256 checksum
How to use checksums
cdf3754a7d4a1cd2066ed9b790d1b9d1800680ddf582a2608848568bc0c6e3a6
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

This release

0.1.2 This release

2 release files

0.1.1

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