Skip to main content

polar-ble-tools

PyPI Python License

Offline-first Python tools for on-device data collection and local retrieval from supported Polar wearable devices over Bluetooth Low Energy.

Currently supported devices are Polar Loop Gen 2 and Polar Verity Sense. Support is limited to the controlled, device-specific behavior documented in the compatibility matrix.

polar-ble-tools supports workflows in which a wearable records data to its own storage and the resulting files are retrieved later over BLE. It provides device setup, offline recording control, PFTP file retrieval, integrity manifests, guarded cleanup, and optional local decoding for supported formats. Data collection and retrieval do not require Polar Flow.

This repository is deliberately limited to BLE tooling: protocol access, device-facing operations, local persistence safeguards, and helpers that make one BLE operation safe and usable. Higher-level application orchestration belongs in an orchestration layer built on these APIs, and is out of scope for this project.

polar-ble-tools is an unofficial community project. It is not affiliated with, endorsed by, sponsored by, or maintained by Polar Electro Oy.

Data collection workflow

The package supports a device-resident collection lifecycle:

  1. discover, pair, and prepare a supported wearable through Linux BlueZ;
  2. inspect supported PMD recording capabilities and configure an offline recording;
  3. allow the wearable to collect data into its own storage;
  4. reconnect over BLE and enumerate files through PFTP;
  5. retrieve .REC or .BPB files into local storage;
  6. verify retrieved files using recorded size and SHA-256 metadata;
  7. review guarded cleanup decisions before removing verified device files;
  8. decode supported formats locally when the required optional tooling is available.

Capabilities

  • manage supported PMD offline recordings and recording settings;
  • list, retrieve, and manage device-resident files through PFTP;
  • retrieve raw .REC recordings with SHA-256 manifests and guarded cleanup;
  • retrieve passive .BPB files and decode supported data with local schemas;
  • discover, pair, trust, and connect devices through Linux BlueZ;
  • validate and apply first-time-use (FTU) data;
  • generate and verify optional local schemas from a separately obtained SDK;
  • locally decode supported .REC files to validated JSONL with an optional SDK sidecar.

Installation

Device operations require Linux, BlueZ, and bluetoothctl. Python 3.11 or newer is supported.

python -m pip install polar-ble-tools
polar-ble --help

Install the optional schema compiler only for SDK-assisted FTU encoding and BPB decoding:

python -m pip install "polar-ble-tools[sdk]"
polar-ble sdk install

The installer asks for a simple y/N confirmation that proceeding accepts the Polar BLE SDK licence. This happens on every install/download invocation, including cache reuse. Use -y for non-interactive installation.

Quick start

Discover and pair a device:

polar-ble discover --scan-seconds 15 --name Polar
polar-ble pair --mac-address AA:BB:CC:DD:EE:FF --scan-seconds 15

List device-resident files:

polar-ble raw --mac-address AA:BB:CC:DD:EE:FF list

Collect raw recordings:

polar-ble raw --mac-address AA:BB:CC:DD:EE:FF collect

Review a cleanup without deleting device files:

polar-ble raw --mac-address AA:BB:CC:DD:EE:FF cleanup --all --dry-run

See device setup, offline recording, and raw retrieval before performing device mutations.

Compatibility

Controlled hardware validation covers Polar Loop Gen 2 and Polar Verity Sense on Linux/BlueZ. Other devices exposing the required PMD and PFTP services may work but are not confirmed for this release. See compatibility for the verified capability matrix and limitations.

Optional SDK-assisted functionality

The package does not distribute the Polar BLE SDK, Polar SDK schema files, or artefacts generated from those files. Optional SDK-assisted functionality uses an SDK copy separately obtained and licensed by the user.

SDK download, inspection, generation, verification, activation, and removal are explicit polar-ble sdk commands. Package installation and import never perform those operations. See SDK integration.

REC decoding is optional and local-only. It requires a separately installed SDK and a user-built decoder; no SDK source or decoder binary is distributed:

polar-ble sdk decoder build
polar-ble rec status
polar-ble rec decode PPI0.REC --output PPI0.jsonl

See REC decoding for prerequisites, protocol, cache, security boundary, and limitations; see compatibility for the evidence-backed matrix.

Documentation and development

Licence and trademarks

Project-authored content is licensed under the Apache License 2.0. See NOTICE for attribution, trademark, and SDK-separation notices.

Polar and related product names are trademarks of Polar Electro Oy and are used solely to identify compatible devices.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

polar_ble_tools-0.4.0.tar.gz (119.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

polar_ble_tools-0.4.0-py3-none-any.whl (153.2 kB view details)

Uploaded Python 3

File details

Details for the file polar_ble_tools-0.4.0.tar.gz.

File metadata

  • Download URL: polar_ble_tools-0.4.0.tar.gz
  • Upload date:
  • Size: 119.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for polar_ble_tools-0.4.0.tar.gz
Algorithm Hash digest
SHA256 55d8003840d1e106e8913e874897a76b9448235262b37a0f170b37242c8e4322
MD5 54a23055d2a9a965ab42477d4f7b926c
BLAKE2b-256 68b318ac6a47541a4bed6794e5f2b7254b7562dee2b0fcd689d2952a0ad05aac

See more details on using hashes here.

Provenance

The following attestation bundles were made for polar_ble_tools-0.4.0.tar.gz:

Publisher: pypi-release.yml on zyf0717/polar-ble-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file polar_ble_tools-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: polar_ble_tools-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 153.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for polar_ble_tools-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 00e782166f3d77a0730e9e869c4dccb00fe65f3cee960492df74249cd4daaba3
MD5 7747c6a6865c0344b6c9b57024ae019f
BLAKE2b-256 74e6844b044cfe0e81dad90243bb6824c20c0cac935db51145d2e00cc8c4e1c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for polar_ble_tools-0.4.0-py3-none-any.whl:

Publisher: pypi-release.yml on zyf0717/polar-ble-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.5.0

2 files

0.4.1

2 files

This release

0.4.0 This release

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.1

2 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