Skip to main content

An asynchronous BLE Heart Monitor library with support for additional data from Polar monitors (ECG, accelerometers, etc)

Project description

🖤 BleakHeart

An asynchronous BLE Heart Monitor library that supports additional measurements (such as ECG and accelerometer data) available from Polar sensors through the Polar Measurement Data interface.

BleakHeart is written in Python using the asyncio framework; BLE communication is based on Bleak.

Installation

Install from PyPI using pip:

python3 -m pip install "bleakheart"

Features

  • Supports heart rate acquisition for devices supporting the standard BLE heart rate service, including RR intervals, instant heart rate, energy expenditure and (client-based) time stamps;
  • Reads Accelerometer and ECG signals from the Polar H10 chest strap;
  • Offers partial support for measurements available from other Polar devices through the Polar Measurement Data interface;
  • Normalises Polar sensor timestamps to Epoch time;
  • Reads the battery charge state through the standard BLE battery service (also available on other types of BLE devices).

Usage

BleakHeart supports a variety of software design choices. Specifically:

  • A data producer/consumer model can be easily implemented by asking BleakHeart to push sensor data onto asynchronous queues;
  • Alternatively, data can be sent to a callback. Simple tasks such as sensor logging can be accomplished with only a minimal understanding of asyncio;
  • All data are tagged with their measurement type; thus the same queue or callback can be used to handle different types of measurements if desired.

Please see the examples directory for detailed examples of some of the possible workflows, and use the help function on BleakHeart objects for more information.

Limitations

BleakHeart has mainly been tested on a Polar H10 chest strap (under Linux), since that is what I have available. However, reports from Windows and MacOS users have been positive. Other Polar devices are only partly supported; measurements other than ECG and acceleration are returned as raw bytearrays. Offline recording to the internal Polar H10 memory is not supported.

Credits and contributing

This software was originally developed and is maintained by Fabrizio Smeraldi. Many thanks to

for testing, suggestions and code. If you would like to contribute, please get in touch.

Academic use

If you use this software for academic research, please reference this repository and let me know. I will cite your paper! :)

Disclaimer and license

Polar is a trademark of Polar Electro Oy; Bleak is an open-source BLE library developed by Henrik Blidh. The author is not affiliated with either.

This software is provided subject to the terms of the Mozilla Public License version 2.0, in the hope that it will be useful; see the LICENSE file for details.

Resources

Project details


Download files

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

Source Distribution

bleakheart-0.1.3.tar.gz (24.6 kB view details)

Uploaded Source

Built Distribution

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

bleakheart-0.1.3-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

Details for the file bleakheart-0.1.3.tar.gz.

File metadata

  • Download URL: bleakheart-0.1.3.tar.gz
  • Upload date:
  • Size: 24.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.12

File hashes

Hashes for bleakheart-0.1.3.tar.gz
Algorithm Hash digest
SHA256 e9341ab3d5e50030b9727ed9d2e08f5c251177ff4142d9fb962c66f9267dbb46
MD5 430dc8f65d97d177a3229ea1612824b3
BLAKE2b-256 758b22abc3b08286c360eb2fa6cc21954a154bd13c79ab35c78f4af121464769

See more details on using hashes here.

File details

Details for the file bleakheart-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: bleakheart-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 21.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.12

File hashes

Hashes for bleakheart-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 653648d34ea3b0bc60f5fbc9b26a53432c0ce87310cd8cb5d9ed094329c936aa
MD5 85c6b8d49047ea22d032b6cc707a5467
BLAKE2b-256 dfdbfd026dad512e8d9b1c21b43e5d7bd54b8922d701cbbb646ed7a838fabf35

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page