WFDB Python Package

The WFDB Python package is a native Python library for reading, writing, processing, and visualizing physiologic signal and annotation data. It adheres to the WFDB format specification and is designed to be user-friendly for researchers and developers working with biomedical waveform data.


Installation

You can install the latest stable release from PyPI:

pip install wfdb

For the development version or to contribute:

git clone https://github.com/MIT-LCP/wfdb-python.git
cd wfdb-python
pip install .

To install with development dependencies:

pip install ".[dev]"

Repository and Contributions

Contributions are welcome! Please refer to the DEVELOPING.md guide for instructions on contributing, including code style, testing, and documentation requirements.


Basic Usage Example

import wfdb

# Download and read a WFDB record from PhysioNet
record = wfdb.rdrecord('100', pn_dir='mitdb')

# Plot the signal
wfdb.plot_wfdb(record=record, title='Record 100 from MIT-BIH Arrhythmia Database')

This example reads record 100 from the MIT-BIH Arrhythmia Database hosted on PhysioNet and plots the signal.


Features

  • Read and write WFDB signal (.dat) and header (.hea) files
  • Read and write annotation files (.atr, .ann, etc.)
  • Support for reading records directly from PhysioNet
  • Signal visualization with customizable plots
  • Integration with NumPy and Pandas for data analysis
  • Support for various signal formats and compression methods

Citing

If you use the WFDB Python package in your research, please cite the software publication available on PhysioNet.