heartpy

Python Heart Rate Analysis Package, for both PPG and ECG signals

https://github.com/paulvangentcom/heartrate_analysis_python

Science Score: 33.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 11 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
    1 of 14 committers (7.1%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.3%) to scientific vocabulary

Keywords

heart heart-rate-analysis heart-rate-data heartrate heartrate-analysis python rate
Last synced: 6 months ago · JSON representation

Repository

Python Heart Rate Analysis Package, for both PPG and ECG signals

Basic Info
  • Host: GitHub
  • Owner: paulvangentcom
  • License: mit
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 22.3 MB
Statistics
  • Stars: 1,038
  • Watchers: 25
  • Forks: 337
  • Open Issues: 22
  • Releases: 3
Topics
heart heart-rate-analysis heart-rate-data heartrate heartrate-analysis python rate
Created almost 9 years ago · Last pushed almost 3 years ago
Metadata Files
Readme Changelog License

README.md

HeartPy - Python Heart Rate Analysis Toolkit

DOI Build Status codecov PyPI - Python Version

Like HeartPy? Don't forget to leave a star!

Structural update

HeartPy V1.2 has landed! The structure of the package has been reworked to be in separate modules now in preparation of the next big update, which will feature many analysis expansions and the first steps towards a GUI for HeartPy. HeartPy has been growing steadily and had reached the point where it became cluttered and unwieldy to keep in a single file. The API remains unchanged.

An 'Examples' folder has been added to the repo which will be expanded soon. Now there's two notebooks explaining how to analyse ppg signals from smartwatches and smart rings.

Colorblind support has been added, see this notebook in the examples folder

Installation

python setup.py install

Alternatively, we're also on PIP: python -m pip install heartpy

That's it! Note that Github always has the newest version.

Documentation

The official documentation is online! You can find the official documentation here

Python 2.7

The module compiles and and runs fine on Python 2.7, but the some unit tests fail.

Tutorial notebooks are now available in Examples/

These show how to handle various analysis tasks with HeartPy, from smartwatch data, smart ring data, regular PPG, and regular (and very noisy) ECG. The notebooks sometimes don't render through the github engine, so either open them locally, or use an online viewer like nbviewer.

We recommend you follow the notebooks in order: - 1. Analysing a PPG signal, a notebook for starting out with HeartPy using built-in examples. - 2. Analysing an ECG signal, a notebook for working with HeartPy and typical ECG data. - 3. Analysing smartwatch data, a notebook on analysing low resolution PPG data from a smartwatch. - 4. Analysing smart ring data, a notebook on analysing smart ring PPG data. - 5. Analysing noisy ECG data, an advanced notebook on working with very noisy ECG data, using data from the MIT-BIH noise stress test dataset. - 6. Colorblind mode - How To and Styles

More information

HeartPy, the Python Heart Rate Analysis Toolkit is a module for heart rate analysis in Python. It started as pure-python implementation to analyse physiological data taken in naturalistic driving and cycling experiments.

The module takes a discrete heart rate signal and outputs time-domain and frequency-domain measures often found in scientific literature:

Time domain: * beats per minute, BPM * interbeat interval, IBI * standard deviation if intervals between adjacent beats, SDNN * standard deviation of successive differences between adjacent R-R intervals, SDSD * root mean square of successive differences between adjacend R-R intervals, RMSSD * proportion of differences between R-R intervals greater than 20ms, 50ms, pNN20, pNN50 * median absolute deviation, MAD * Poincare analysis (SD1, SD2, S, SD1/SD2) * Poincare plotting

Frequency domain (ranges per Shaffer and Ginsberg: https://doi.org/10.3389/fpubh.2017.00258) * very low frequency component (0.0033–0.04 Hz), VLF * low frequency component (0.04–0.15 Hz), LF * high frequency component (0.15–0.4 Hz), HF * lf/hf ratio, LF/HF

When using the package in your research, please cite:

van Gent, P., Farah, H., van Nes, N., & van Arem, B. (2019). Analysing Noisy Driver Physiology Real-Time Using Off-the-Shelf Sensors: Heart Rate Analysis Software from the Taking the Fast Lane Project. Journal of Open Research Software, 7(1), 32. DOI: http://doi.org/10.5334/jors.241

van Gent, P., Farah, H., van Nes, N., & van Arem, B. (2019). HeartPy: A novel heart rate algorithm for the analysis of noisy signals. Transportation Research Part F: Traffic Psychology and Behaviour, 66, 368–378. https://doi.org/10.1016/j.trf.2019.09.015

Documentation

You can find the official documentation here

The module is also to some extent described in my tutorial series:

License

The module is licensed under the MIT License

Validation

Initial results of the validation have been reported in [1, 2].

[1]van Gent, P., Farah, H., van Nes, N., & van Arem, B. (2018). Heart Rate Analysis for Human Factors: Development and Validation of an Open Source Toolkit for Noisy Naturalistic Heart Rate Data. In Proceedings of the 6th HUMANIST Conference (pp. 173–178).

[2] van Gent, P., Farah, H., van Nes, N., & van Arem, B. (2019). HeartPy: A novel heart rate algorithm for the analysis of noisy signals. Transportation Research Part F: Traffic Psychology and Behaviour, 66, 368–378. https://doi.org/10.1016/j.trf.2019.09.015

To-do

The module is still in active development. See the changelog for past changes. The to-do for the coming months is:

to do before V1.3 - [X] Same but for PPG - morphology too variable, method unstable - [ ] Add 'strictness parameter' to affect how HeartPy evaluates peaks for acceptance/rejection - [ ] Add method to handle NaN data automatically - [ ] clean_rr method now removes incorrect values, update to allow for replacement by median of surrounding data points - [ ] add method that can fill in missing R-peaks, settable to search for either local optimum OR mean imputation. - [ ] Report validation performance on repo (published paper + key-points document once published) - [ ] Change backend structure in anticipation of GUI development - [ ] Develop GUI for HeartPy

Owner

  • Name: Paul van Gent
  • Login: paulvangentcom
  • Kind: user
  • Company: Delft University of Technology

GitHub Events

Total
  • Issues event: 1
  • Watch event: 102
  • Fork event: 19
Last Year
  • Issues event: 1
  • Watch event: 102
  • Fork event: 19

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 342
  • Total Committers: 14
  • Avg Commits per committer: 24.429
  • Development Distribution Score (DDS): 0.17
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Paul van Gent p****9@g****m 284
Constantino Álvarez A****c 14
Andrew Davis s****p@g****m 14
Arritmic a****c@g****m 12
Jonathan j****s@g****m 3
Igor i****g 3
Manuel Meier m****r@i****h 3
Alex Page a****e@g****m 2
Manuel Meier m****l@m****h 2
Kris b****0@s****e 1
Glenn Fernandes 1****f 1
Eeshan Gupta e****5@g****m 1
Michael Gathara m****m@g****m 1
Andrew Davis A****s 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 88
  • Total pull requests: 20
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 3 months
  • Total issue authors: 61
  • Total pull request authors: 12
  • Average comments per issue: 2.34
  • Average comments per pull request: 1.0
  • Merged pull requests: 15
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 2
  • Pull requests: 0
  • Average time to close issues: about 1 hour
  • Average time to close pull requests: N/A
  • Issue authors: 2
  • Pull request authors: 0
  • Average comments per issue: 0.5
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • paulvangentcom (9)
  • FrancoisCosta (6)
  • sedurCode (3)
  • meierman1 (3)
  • mshafieluru (2)
  • sakluk (2)
  • PartyTrix (2)
  • talhaanwarch (2)
  • yurasmol (2)
  • saranzeb (2)
  • christianschneebeli (2)
  • kmf909 (2)
  • abdulkhaliq7 (2)
  • renatosc (2)
  • vishakha18tiwari (1)
Pull Request Authors
  • AndrewDDavis (5)
  • meierman1 (3)
  • Arritmic (3)
  • IgorWounds (2)
  • atpage (1)
  • KrisITB (1)
  • J535D165 (1)
  • eeshan9815 (1)
  • Michaelgathara (1)
  • igrowing (1)
  • glenn124f (1)
  • koenraijer (1)
Top Labels
Issue Labels
enhancement (9) bug (6) question (2) external integration (1)
Pull Request Labels
bug (1) enhancement (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 5,314 last-month
  • Total docker downloads: 37
  • Total dependent packages: 12
  • Total dependent repositories: 42
  • Total versions: 11
  • Total maintainers: 1
pypi.org: heartpy

Heart Rate Analysis Toolkit

  • Versions: 11
  • Dependent Packages: 12
  • Dependent Repositories: 42
  • Downloads: 5,314 Last month
  • Docker Downloads: 37
Rankings
Dependent packages count: 0.9%
Stargazers count: 2.2%
Dependent repos count: 2.3%
Average: 2.5%
Forks count: 2.9%
Docker downloads count: 3.4%
Downloads: 3.6%
Maintainers (1)
Last synced: 6 months ago

Dependencies

setup.py pypi
  • cycler ==0.10.0
  • kiwisolver ==1.1.0
  • matplotlib <=3.1.2
  • matplotlib <=3.0.0
  • matplotlib <=2.2.3
  • matplotlib *
  • matplotlib <=3.3.4
  • matplotlib ==2.2.3
  • numpy >=1.17
  • numpy <=1.15
  • numpy <=1.17
  • pyparsing ==2.4.7
  • scipy <=1.1.0
  • scipy *
  • scipy <=1.2.0
  • scipy <=1.4.1