Skip to content

cryptonome/wfdb-python

 
 

Repository files navigation

The WFDB Python Package

signals

tests workflow PyPI Downloads PhysioNet Project Supported Python Versions

Introduction

A Python-native package for reading, writing, processing, and plotting physiologic signal and annotation data. The core I/O functionality is based on the Waveform Database (WFDB) specifications.

This package is heavily inspired by the original WFDB Software Package, and initially aimed to replicate many of its command-line APIs. However, the projects are independent, and there is no promise of consistency between the two, beyond each package adhering to the core specifications.

Documentation and Usage

See the documentation site for the public APIs.

See the demo.ipynb notebook file for example use cases.

Installation

The distribution is hosted on PyPI at: https://pypi.python.org/pypi/wfdb/. The package can be directly installed from PyPI using either pip or poetry:

pip install wfdb
poetry add wfdb

The development version is hosted at: https://github.com/MIT-LCP/wfdb-python. This repository also contains demo scripts and example data. To install the development version, clone or download the repository, navigate to the base directory, and run:

# Without dev dependencies
pip install .
poetry install

# With dev dependencies
pip install ".[dev]"
poetry install -E dev

See the note below about dev dependencies.

Developing

We welcome community contributions in the form of pull requests. When contributing code, please ensure:

  • PEP8 style guidelines are followed.
  • Documentation is provided. New functions and classes should have numpy/scipy style docstrings.
  • Unit tests are written for new features that are not covered by existing tests.

Package Management

This project uses poetry for package management and distribution.

Development dependencies are specified as optional dependencies, and then added to the "dev" extra group in the pyproject.toml file.

# Do NOT use: poetry add <somepackage> --dev
poetry add --optional <somepackage>

The [tool.poetry.dev-dependencies] attribute is NOT used because of a limitation that prevents these dependencies from being pip installable. Therefore, dev dependencies are not installed when purely running poetry install, and the --no-dev flag has no meaning in this project.

Make sure the versions in version.py and pyproject.toml are kept in sync.

To upload a new distribution to PyPI:

poetry publish

Citing

When using this resource, please cite the software publication oh PhysioNet.

About

Native Python WFDB package

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Jupyter Notebook 79.9%
  • Python 20.1%