- downloading and reading open polysomnography datasets,
- detecting heartbeats from ECG signals, and
- classifying sleep stages (which includes preprocessing, feature extraction, and classification).
Documentation for SleepECG is available on Read the Docs.
Check out the changelog to learn what we added, changed, or fixed.
SleepECG requires Python ≥ 3.8 and the following packages:
Optional dependencies provide additional features:
- joblib ≥ 1.0.0 (parallelized feature extraction)
- matplotlib ≥ 3.5.0 (plot ECG time courses, hypnograms, and confusion matrices)
- mne ≥ 1.0.0 (read data from MESA and SHHS)
- numba ≥ 0.55.0 (JIT-compiled heartbeat detector)
- pandas ≥ 1.4.0 (read data from GUDB)
- tensorflow ≥ 2.7.0 (sleep stage classification with Keras models)
- wfdb ≥ 3.4.0 (read data from SLPDB, MITDB, and LTDB)
SleepECG is available on PyPI and can be installed with pip:
Alternatively, an unofficial conda package is available:
SleepECG with all optional dependencies can be installed with the following command:
If you want the latest development version, use the following command:
The contributing guide contains detailed instructions on how to contribute to SleepECG.