Skip to main content

A package for sleep stage classification using ECG data

Project description

Python PyPI Docs DOI License

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.

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

sleepecg-0.5.9.tar.gz (570.5 kB view details)

Uploaded Source

Built Distributions

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

sleepecg-0.5.9-cp310-abi3-win_amd64.whl (412.2 kB view details)

Uploaded CPython 3.10+Windows x86-64

sleepecg-0.5.9-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (419.5 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

sleepecg-0.5.9-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (419.6 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

sleepecg-0.5.9-cp310-abi3-macosx_11_0_arm64.whl (408.3 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

sleepecg-0.5.9-cp310-abi3-macosx_10_9_x86_64.whl (407.9 kB view details)

Uploaded CPython 3.10+macOS 10.9+ x86-64

File details

Details for the file sleepecg-0.5.9.tar.gz.

File metadata

  • Download URL: sleepecg-0.5.9.tar.gz
  • Upload date:
  • Size: 570.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for sleepecg-0.5.9.tar.gz
Algorithm Hash digest
SHA256 f15ee55ec5567e13cb57a99009d2fe8533702a32cbb4d24c0551fefd45e920ac
MD5 cc31fe37771a2dad8a7a9791bd27955e
BLAKE2b-256 10e4ff5e2b6d7241bc4c214e5142f794d615e4cd41e92e74fae61460f3509d14

See more details on using hashes here.

Provenance

The following attestation bundles were made for sleepecg-0.5.9.tar.gz:

Publisher: cibuildwheel.yml on cbrnr/sleepecg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sleepecg-0.5.9-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: sleepecg-0.5.9-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 412.2 kB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for sleepecg-0.5.9-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 72b52ce1ecef5a84faeb588dd577bb64aa94bf9ff4ff5e4ac371cadc59959600
MD5 e90eb1049d8a66eaf566ee9229570f81
BLAKE2b-256 4fe9347df67216bf9720a6d986f4ea22a3924f1f026eaa9419117567fe1a002d

See more details on using hashes here.

Provenance

The following attestation bundles were made for sleepecg-0.5.9-cp310-abi3-win_amd64.whl:

Publisher: cibuildwheel.yml on cbrnr/sleepecg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sleepecg-0.5.9-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for sleepecg-0.5.9-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c52258ff78c7fd7fa38ca32fe348e0fb1c52e5c402741d9b268cf0b170719125
MD5 aecfb53f230756fe9d0e55fd551d1267
BLAKE2b-256 c99bb24159a3cfd271b9c90b325865adbb5cd1625092a6c57dff61beca7b988c

See more details on using hashes here.

Provenance

The following attestation bundles were made for sleepecg-0.5.9-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: cibuildwheel.yml on cbrnr/sleepecg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sleepecg-0.5.9-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sleepecg-0.5.9-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8b2f6170cbec9e3216498b0839702e2ca6b580955700a33c8770c4d9ad74d96e
MD5 113aaa113eebbc838bb6a92b996ab934
BLAKE2b-256 cb29cbc1040d76b53207db86a39714e157198690ccf93e67d350ad52137e2c1d

See more details on using hashes here.

Provenance

The following attestation bundles were made for sleepecg-0.5.9-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: cibuildwheel.yml on cbrnr/sleepecg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sleepecg-0.5.9-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sleepecg-0.5.9-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1e982b3f31be0b21adae1b2042b75a0078b46c07157e20cd4fdcd717587144da
MD5 1b22403467589aecb8eef22db31bb4ab
BLAKE2b-256 a0ae78d951bbea27448b5d33c8bd1fca0c6fe26eee6c608a302b665016e97c6c

See more details on using hashes here.

Provenance

The following attestation bundles were made for sleepecg-0.5.9-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: cibuildwheel.yml on cbrnr/sleepecg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sleepecg-0.5.9-cp310-abi3-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for sleepecg-0.5.9-cp310-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 719321e0ecec040f3a2a6a4de08901fbe41b2fd27d99615d07fccb20b5722f63
MD5 5506c03a5a874ccac142680d81237b67
BLAKE2b-256 a34268b87fe6547d49a36c40d68b0d0dd16b8a696fbda2e6f3df124d909a3b71

See more details on using hashes here.

Provenance

The following attestation bundles were made for sleepecg-0.5.9-cp310-abi3-macosx_10_9_x86_64.whl:

Publisher: cibuildwheel.yml on cbrnr/sleepecg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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