{"id":13592311,"url":"https://github.com/Aura-healthcare/hrv-analysis","last_synced_at":"2025-04-08T23:31:57.822Z","repository":{"id":40376013,"uuid":"148614675","full_name":"Aura-healthcare/hrv-analysis","owner":"Aura-healthcare","description":"Package for Heart Rate Variability analysis in Python","archived":false,"fork":false,"pushed_at":"2024-11-11T14:43:05.000Z","size":9407,"stargazers_count":407,"open_issues_count":21,"forks_count":98,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-21T07:09:19.280Z","etag":null,"topics":["feature-engineering","heart-rate-variability","python","rr-interval"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Aura-healthcare.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"code-of-conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-13T09:27:19.000Z","updated_at":"2025-03-18T21:21:48.000Z","dependencies_parsed_at":"2024-11-05T22:32:26.734Z","dependency_job_id":null,"html_url":"https://github.com/Aura-healthcare/hrv-analysis","commit_stats":{"total_commits":129,"total_committers":6,"mean_commits":21.5,"dds":"0.054263565891472854","last_synced_commit":"285019ab52b5dce4a4da89a5df212037fd0973a5"},"previous_names":["aura-healthcare/hrvanalysis"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aura-healthcare%2Fhrv-analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aura-healthcare%2Fhrv-analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aura-healthcare%2Fhrv-analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aura-healthcare%2Fhrv-analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aura-healthcare","download_url":"https://codeload.github.com/Aura-healthcare/hrv-analysis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247947818,"owners_count":21023057,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["feature-engineering","heart-rate-variability","python","rr-interval"],"created_at":"2024-08-01T16:01:07.892Z","updated_at":"2025-04-08T23:31:57.814Z","avatar_url":"https://github.com/Aura-healthcare.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Heart Rate Variability analysis\n\n[![PyPI version](https://badge.fury.io/py/hrv-analysis.svg)](https://badge.fury.io/py/hrv-analysis)\n[![Build Status](https://github.com/Aura-healthcare/hrv-analysis/actions/workflows/ci.yml/badge.svg)](https://github.com/Aura-healthcare/hrv-analysis/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/Aura-healthcare/hrv-analysis/branch/master/graph/badge.svg)](https://codecov.io/gh/Aura-healthcare/hrv-analysis)\n[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n[![Downloads](https://pepy.tech/badge/hrv-analysis)](https://pepy.tech/project/hrv-analysis)\n\n**hrvanalysis** is a Python module for Heart Rate Variability analysis of RR-intervals built on top of SciPy, AstroPy, Nolds and NumPy and distributed under the GPLv3 license.\n\nThe development of this library started in July 2018 as part of [Aura Healthcare](https://www.aura.healthcare) project, in [OCTO Technology](https://www.octo.com/fr) R\u0026D team and is maintained by Robin Champseix.\n\n\n![alt text](https://github.com/Aura-healthcare/hrv-analysis/blob/master/figures/timeserie_distrib_plot.png)\n\n**Full documentation** : https://aura-healthcare.github.io/hrv-analysis\n\n**Website** : https://www.aura.healthcare\n\n**Github** : https://github.com/Aura-healthcare\n\n**Version** : 1.0.4\n\n\n## Installation / Prerequisites\n\n#### User installation\n\nThe easiest way to install hrv-analysis is using ``pip`` :\n\n    $ pip install hrv-analysis\n\nyou can also clone the repository:\n\n    $ git clone https://github.com/Aura-healthcare/hrv-analysis.git\n    $ cd hrv-analysis\n    $ uv sync --all-extras\n\n#### Dependencies\n\n**hrvanalysis** requires the following:\n- Python (\u003e= 3.5)\n- astropy \u003e= 3.0.4\n- future \u003e= 0.16.0\n- nolds \u003e= 0.4.1\n- numpy \u003e= 1.15.1\n- scipy \u003e= 1.1.0\n\nNote: The package can be used with all Python versions from 3.5 to latest version (currently Python 3.9).\n\n\n## Getting started\n\n### Outliers and ectopic beats filtering methods\n\nThis package provides methods to remove outliers and ectopic beats from signal for further analysis. Those methods are useful to get Normal to Normal Interval (NN-intervals) from RR-intervals.\nPlease use this methods carefully as they might have a huge impact on features calculation.\n\n```python\nfrom hrvanalysis import remove_outliers, remove_ectopic_beats, interpolate_nan_values\n\n# rr_intervals_list contains integer values of RR-interval\nrr_intervals_list = [1000, 1050, 1020, 1080, ..., 1100, 1110, 1060]\n\n# This remove outliers from signal\nrr_intervals_without_outliers = remove_outliers(rr_intervals=rr_intervals_list,  \n                                                low_rri=300, high_rri=2000)\n# This replace outliers nan values with linear interpolation\ninterpolated_rr_intervals = interpolate_nan_values(rr_intervals=rr_intervals_without_outliers,\n                                                   interpolation_method=\"linear\")\n\n# This remove ectopic beats from signal\nnn_intervals_list = remove_ectopic_beats(rr_intervals=interpolated_rr_intervals, method=\"malik\")\n# This replace ectopic beats nan values with linear interpolation\ninterpolated_nn_intervals = interpolate_nan_values(rr_intervals=nn_intervals_list)\n```\n\nYou can find how to use the following methods, references and more details in the [documentation](https://aura-healthcare.github.io/hrv-analysis/tutorial.html):\n- remove_outliers\n- remove_ectopic_beats\n\n\n### Features calculation\n\nThere are 4 types of features you can get from NN-intervals:\n\n\u003e Time domain features : **Mean_NNI, SDNN, SDSD, NN50, pNN50, NN20, pNN20, RMSSD, Median_NN, Range_NN, CVSD, CV_NNI, Mean_HR, Max_HR, Min_HR, STD_HR**\n\n\u003e Geometrical domain features : **Triangular_index, TINN**\n\n\u003e Frequency domain features : **LF, HF, VLF, LH/HF ratio, LFnu, HFnu, Total_Power**\n\n\u003e Non Linear domain features : **CSI, CVI, Modified_CSI, SD1, SD2, SD1/SD2 ratio, SampEn**\n\nAs an exemple, what you can compute to get Time domain analysis is :\n\n```python\nfrom hrvanalysis import get_time_domain_features\n\n # nn_intervals_list contains integer values of NN-interval\nnn_intervals_list = [1000, 1050, 1020, 1080, ..., 1100, 1110, 1060]\n\ntime_domain_features = get_time_domain_features(nn_intervals_list)\n\n\u003e\u003e\u003e time_domain_features\n{'mean_nni': 718.248,\n 'sdnn': 43.113,\n 'sdsd': 19.519,\n 'nni_50': 24,\n 'pnni_50': 2.4,\n 'nni_20': 225,\n 'pnni_20': 22.5,\n 'rmssd': 19.519,\n 'median_nni': 722.5,\n 'range_nni': 249,\n 'cvsd': 0.0272,\n 'cvnni': 0.060,\n 'mean_hr': 83.847,\n 'max_hr': 101.694,\n 'min_hr': 71.513,\n 'std_hr': 5.196}\n```\n\nYou can find how to use the following methods, references and details about each feature in the [documentation](https://aura-healthcare.github.io/hrv-analysis/tutorial.html):\n- get_time_domain_features\n- get_geometrical_features\n- get_frequency_domain_features\n- get_csi_cvi_features\n- get_poincare_plot_features\n- get_sampen\n\n\n### Plot functions\n\nThere are several plot functions that allow you to see, for example, the Power Spectral Density (PSD) for frequency domain features or Poincaré Plot for non linear domain features:\n\n```python\nfrom hrvanalysis import plot_psd\n\n# nn_intervals_list contains integer values of NN-interval\nnn_intervals_list = [1000, 1050, 1020, 1080, ..., 1100, 1110, 1060]\n\nplot_psd(nn_intervals_list, method=\"welch\")\nplot_psd(nn_intervals_list, method=\"lomb\")\n```\n\n![alt text](https://github.com/Aura-healthcare/hrv-analysis/blob/master/figures/psd_periodogram_plot.png)\n\n\n```python\nfrom hrvanalysis import plot_poincare\n\n# nn_intervals_list contains integer values of NN-interval\nnn_intervals_list = [1000, 1050, 1020, 1080, ..., 1100, 1110, 1060]\n\nplot_poincare(nn_intervals_list)\nplot_poincare(nn_intervals_list, plot_sd_features=True)\n```\n\n![alt text](https://github.com/Aura-healthcare/hrv-analysis/blob/master/figures/poincare_plot.png)\n\n\nYou can find how to use methods and details in the [documentation](https://aura-healthcare.github.io/hrv-analysis/tutorial.html):\n- plot_distrib\n- plot_timeseries\n- plot_psd\n- plot_poincare\n\n\nHere is a high level view of the distinct building blocks of the package:\n\n![alt text](https://github.com/Aura-healthcare/hrv-analysis/blob/master/figures/architecture.png)\n\n\n## References\n\nHere are the main references used to compute the set of features and for signal processing methods:\n\n\u003e Heart rate variability - Standards of measurement, physiological interpretation, and clinical use, Task Force of The European Society of Cardiology and The North American Society of Pacing and Electrophysiology, 1996\n\n\u003e Signal Processing Methods for Heart Rate Variability - Gari D. Clifford, 2002\n\n\u003e Physiological time-series analysis using approximate entropy and sample entropy, Joshua S. Richman, J. Randall Moorman - 2000\n\n\u003e Using Lorenz plot and Cardiac Sympathetic Index of heart rate variability for detecting seizures for patients with epilepsy, Jesper Jeppesen et al, 2014\n\n\n## Authors\n\n**Robin Champseix** - (https://github.com/robinchampseix)\n\n\n## License\n\nThis project is licensed under the *GNU GENERAL PUBLIC License* - see the [LICENSE.md](https://github.com/Aura-healthcare/hrv-analysis/blob/master/LICENSE) file for details\n\n## How to contribute\nPlease refer to [How To Contribute](https://github.com/Aura-healthcare/hrv-analysis/blob/master/CONTRIBUTING.md)\n\n## Acknowledgments\n\nI hereby thank Laurent Ribière and Clément Le Couedic, my coworkers who gave me time to Open Source this library.\nI also thank Fabien Arcellier for his advices on to how build a library in PyPi.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAura-healthcare%2Fhrv-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAura-healthcare%2Fhrv-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAura-healthcare%2Fhrv-analysis/lists"}