skillfed

pyEDFlib

library to read/write EDF+/BDF+ files

pyedflib v0.1.42 138.9K downloads/30d#11,314 on PyPI246
Permissive license BSD Active released

What it is and what it does

pyEDFlib is a Python wrapper around EDFlib that reads and writes European Data Format (EDF, EDF+) and BioSemi Data Format (BDF, BDF+) files—standard formats for storing biomedical signals like EEG, ECG, and EMG recordings. The library wraps a C implementation for performance and provides both low-level access and a high-level interface for common tasks. It depends only on numpy and runs on Python 3.8 and later across Windows, macOS, and Linux.

The high-level interface makes it straightforward to load signal arrays with metadata, write new files with channel definitions, and perform file operations like dropping channels, renaming them, anonymizing patient data, and comparing file contents. It is commonly used in neuroscience, sleep medicine, and clinical research workflows where EDF/BDF files are the de facto standard for storing and sharing polysomnography, EEG, and other multi-channel physiological recordings.

Use it for:

  • Load EEG recordings from clinical polysomnography devices and extract specific channels for analysis.
  • Write processed biomedical signals back to EDF+ format for archival or sharing with research teams.
  • Anonymize patient identifiers in EDF files before sharing data for research or regulatory compliance.
  • Rename and reorganize channels within existing EDF files without re-encoding the signal data.
  • Batch convert or validate EDF/BDF files by comparing file contents programmatically.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

pyEDFlib reads and writes EDF+/BDF+ biomedical signal files, with support for channel manipulation, anonymization, and metadata handling.

Yes. pyEDFlib is actively maintained, has no known vulnerabilities, and is the standard choice for EDF/BDF file I/O in Python. Medium install friction is offset by prebuilt wheels for common platforms and a single, lightweight numpy dependency. Install it if you work with biomedical signal files in these formats.

Install

pyedflib on PyPI

pip

pip install pyedflib

uv

uv add pyedflib

poetry

poetry add pyedflib

Installing pyEDFlib

Before you install

Medium install friction due to compiled C extensions, but prebuilt wheels cover Python 3.10, 3.11, and 3.12 on major platforms (macOS, Linux, Windows). Repository is actively maintained with recent commits and no known vulnerabilities.

License in practice

BSD permissive license allows commercial and private use with minimal restrictions; attribution required but no copyleft obligations.

Quickstart

pip install pyEDFlib

from pyedflib import highlevel
import numpy as np

signals = np.random.rand(2, 256)
headers = highlevel.make_signal_headers(['ch1', 'ch2'], sample_frequency=256)
header = highlevel.make_header(patientname='patient1')
highlevel.write_edf('output.edf', signals, headers, header)

signals_read, sig_headers, file_header = highlevel.read_edf('output.edf')

Requires a C compiler and Cython to build from source; binary wheels available for common platforms reduce this friction.

Verify before relying

  • Whether the package handles large files efficiently or has known memory constraints.
  • Real-world performance on concurrent read/write operations or thread safety guarantees.
  • Compatibility with EDF+ extensions beyond the standard (e.g., annotations, event markers).

Package facts

License BSD (permissive)
Python support not specified
Install friction medium — platform-specific wheel
Runtime dependencies 1 — numpy
Maintenance actively maintained — 414 days since the last release
Last repo commit
First released
Downloads 138,945/month — #11,314 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pyedflib-0.1.42-cp310-cp310-macosx_10_9_x86_64.whl; pyedflib-0.1.42-cp310-cp310-macosx_11_0_arm64.whl; pyedflib-0.1.42-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; pyedflib-0.1.42-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; pyedflib-0.1.42-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl; pyedflib-0.1.42-cp310-cp310-musllinux_1_2_i686.whl; pyedflib-0.1.42-cp310-cp310-musllinux_1_2_x86_64.whl; pyedflib-0.1.42-cp310-cp310-win32.whl; pyedflib-0.1.42-cp310-cp310-win_amd64.whl; pyedflib-0.1.42-cp311-cp311-macosx_10_9_x86_64.whl; pyedflib-0.1.42-cp311-cp311-macosx_11_0_arm64.whl; pyedflib-0.1.42-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; pyedflib-0.1.42-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; pyedflib-0.1.42-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl; pyedflib-0.1.42-cp311-cp311-musllinux_1_2_i686.whl; pyedflib-0.1.42-cp311-cp311-musllinux_1_2_x86_64.whl; pyedflib-0.1.42-cp311-cp311-win32.whl; pyedflib-0.1.42-cp311-cp311-win_amd64.whl; pyedflib-0.1.42-cp312-cp312-macosx_10_13_x86_64.whl; pyedflib-0.1.42-cp312-cp312-macosx_11_0_arm64.whl

Keywords: EDFlib, European data format, EDF, BDF, EDF+, BDF+

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: CProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: Software Development :: Libraries :: Python Modules

Tags

EDF file reader writerbiomedical signal formatEDF+ BDF+ PythonEuropean data format libraryEEG data file handlingmedical signal processing filestime series biomedical data
biomedical-signalsfile-formateeg-data

More Python Modules packages