SleepECG
SleepECG provides tools for sleep stage classification when EEG signals are not available. Based only on ECG, SleepECG provides functions for
- downloading and reading open polysomnography datasets,
- detecting heartbeats from ECG signals, and
- classifying sleep stages (which includes preprocessing, feature extraction, and classification).
Documentation
Documentation for SleepECG is available on Read the Docs. Check out the changelog to learn what we added, changed, or fixed.
Installation
SleepECG is available on PyPI and can be installed with pip:
pip install sleepecg
SleepECG with all optional dependencies can be installed with the following command:
pip install "sleepecg[full]"
If you want the latest development version, use the following command:
pip install git+https://github.com/cbrnr/sleepecg
Example
The following example detects heartbeats in a short ECG (a one-dimensional NumPy array):
import numpy as np
from sleepecg import detect_heartbeats, get_toy_ecg
ecg, fs = get_toy_ecg() # 5 min of ECG data at 360 Hz
beats = detect_heartbeats(ecg, fs) # indices of detected heartbeats
Contributing
The contributing guide contains detailed instructions on how to contribute to SleepECG.
Metadata
Release files for sleepecg 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sleepecg-0.6.0.tar.gz | 835.0 kB | Without provenance | Details for sleepecg-0.6.0.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| sleepecg-0.6.0-cp311-abi3-win_amd64.whl | CPython 3.11 | abi3 | Windows x86-64 | Details for sleepecg-0.6.0-cp311-abi3-win_amd64.whl |
| sleepecg-0.6.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl | CPython 3.11 | abi3 | Linux glibc 2.17+ ARM64, Linux glibc 2.28+ ARM64 | Details for sleepecg-0.6.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl |
| sleepecg-0.6.0-cp311-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl | CPython 3.11 | abi3 | Linux glibc 2.5+ x86-64, Linux glibc 2.28+ x86-64 | Details for sleepecg-0.6.0-cp311-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl |
| sleepecg-0.6.0-cp311-abi3-macosx_11_0_arm64.whl | CPython 3.11 | abi3 | macOS 11.0+ ARM64 | Details for sleepecg-0.6.0-cp311-abi3-macosx_11_0_arm64.whl |
Total release size: 2.5 MB
Release files / sleepecg-0.6.0.tar.gz
| Download URL | sleepecg-0.6.0.tar.gz |
|---|---|
| Size | 835.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
474eee95698d2774ccd221f9d0dfa9048e8360b9b155673f90eec8dc5d677de3
|
|
BLAKE2b-256 checksum How to use checksums |
aa8a29e935caa6302a06352edf8ad005e39e37c5c549187d0acba5e630bf74e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / sleepecg-0.6.0-cp311-abi3-win_amd64.whl
| Download URL | sleepecg-0.6.0-cp311-abi3-win_amd64.whl |
|---|---|
| Size | 417.8 kB |
| Tags | CPython 3.11 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
6dadb68fb2f9f503cdd64cd2a202b394131949782d229840005a9066a44b7924
|
|
BLAKE2b-256 checksum How to use checksums |
7f529aa23cedaff6c6d008e3e504941bfc0d1e820d64bb4cfc3c6d79ecf9e4af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / sleepecg-0.6.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
| Download URL | sleepecg-0.6.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 427.5 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
5cbd3425abea5df458ee387d8b2561eee3fcb6b9768b68d8c8a181000d73e9da
|
|
BLAKE2b-256 checksum How to use checksums |
fc07848b5f67e1af23907f2b5135373bb4cd3b7f83f22b34d95e09d8ee8ee3fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / sleepecg-0.6.0-cp311-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
| Download URL | sleepecg-0.6.0-cp311-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl |
|---|---|
| Size | 427.2 kB |
| Tags | CPython 3.11 Linux glibc 2.28+ x86-64 Linux glibc 2.5+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
1e4379b1e0a9358f55df093d73246da9170d98ab868071284a04bc603e610c24
|
|
BLAKE2b-256 checksum How to use checksums |
b077ce346194a5755bfe71f7841ae049c7cd1a14f6467a5969c73170ec4e88d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / sleepecg-0.6.0-cp311-abi3-macosx_11_0_arm64.whl
| Download URL | sleepecg-0.6.0-cp311-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 415.0 kB |
| Tags | CPython 3.11 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
e487c4a1298f37d38462ca33383b7813377df34d3b8d45544bf4cb62b5f65e25
|
|
BLAKE2b-256 checksum How to use checksums |
7f89cfbd6840f7e767200fdb279e2889ea3bfc813d75e172cefc6014bcaba3b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for sleepecg 0.6.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.