pyEDFlib
library to read/write EDF+/BDF+ files
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 pyedflibuv
uv add pyedflibpoetry
poetry add pyedflibInstalling 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+
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
edfioedfio reads and writes EDF, EDF+C, BDF, and…
permissive · top 15,000 on PyPI
pyjlsReads and writes JLS (Joulescope) files, a…
permissive · top 15,000 on PyPI
neoNeo provides a unified data model for…
permissive · top 15,000 on PyPI
wfdbRead, write, process, and plot physiologic…
permissive · top 15,000 on PyPI
reqifReqIF is a Python library for parsing,…
permissive · top 15,000 on PyPI
fabioFabIO reads and writes 2D X-ray detector images…
permissive · top 15,000 on PyPI
eccodesReads and writes GRIB and BUFR meteorological…
permissive · top 5,000 on PyPI
asammdfasammdf parses, edits, and exports ASAM MDF…
copyleft · top 5,000 on PyPI
mne-bidsMNE-BIDS reads and writes neuroimaging datasets…
permissive · top 15,000 on PyPI
dbfreadReads DBF database files (dBase, Visual FoxPro,…
permissive · top 5,000 on PyPI