edfio
Read and write EDF/EDF+C/BDF/BDF+C files.
What it is and what it does
edfio is a Python library for reading and writing EDF (European Data Format) and related biomedical signal files—formats widely used in EEG, sleep studies, and other physiological recording domains. It wraps NumPy for fast I/O, allowing you to load and save gigabyte-scale recordings, manipulate signal and recording metadata, drop or anonymize signals, slice by time or annotation, and work with both standard EDF and the extended EDF+ and BDF variants. The library uses an object-oriented design with full type annotations, making it IDE-friendly, and includes 100% test coverage.
The package trades some flexibility for safety: on read, it tolerates non-compliant headers and only raises exceptions when you access the problematic field; on write, it validates upfront to prevent creating invalid files. It does not enforce the EDF spec's recommended 61440-byte data record size limit, and discontiguous (EDF+D) files are treated as contiguous. Slicing to non-integer multiples of the data record duration is not supported.
Use it for:
- Load EEG or polysomnography recordings from clinical EDF files for signal processing or machine learning pipelines.
- Convert or migrate between EDF, EDF+C, BDF, and BDF+C formats while preserving or modifying annotations.
- Anonymize patient recordings by dropping or modifying signal headers and metadata before sharing.
- Slice multi-hour sleep studies into shorter segments aligned to annotation events (e.g., sleep stages).
- Build a data pipeline that reads raw biomedical signals, modifies headers, and writes compliant output files.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
edfio reads and writes EDF, EDF+C, BDF, and BDF+C files—standard formats for physiological signal recording—with NumPy-backed I/O for fast processing of large files.
Yes. edfio is actively maintained, has no known vulnerabilities, low install friction, and fills a clear niche for EDF/BDF file handling in Python. It is suitable for production use in biomedical signal processing workflows if your use case does not require discontiguous file support or non-integer-duration slicing.
Install
edfio on PyPI
pip
pip install edfiouv
uv add edfiopoetry
poetry add edfioInstalling edfio
Before you install
Low install friction: pure Python wheel with only numpy and typing-extensions as runtime dependencies. Active maintenance with a release 14 days ago and commits through August 2026.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install edfio
from edfio import read_edf
edf = read_edf("example.edf")
# Or create and write:
import numpy as np
from edfio import Edf, EdfSignal
edf = Edf([EdfSignal(np.random.randn(30 * 256), sampling_frequency=256, label="EEG")])
edf.write("output.edf")
Requires Python>=3.9 and NumPy>=1.22; slicing to non-integer-multiple timespans of data record duration is not supported.
Verify before relying
- Performance characteristics for files larger than a few GB and whether 'seconds' speed claim is typical or best-case.
- Whether 'fail late on read' behavior is appropriate for your use case or if early validation is needed.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — numpy, typing-extensions |
| Maintenance | actively maintained — 14 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 92,544/month — #13,445 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: edfio-0.4.16-py3-none-any.whl
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
pyEDFlibpyEDFlib reads and writes EDF+/BDF+ biomedical…
permissive · top 15,000 on PyPI
wfdbRead, write, process, and plot physiologic…
permissive · top 15,000 on PyPI
SigMFReads and writes Signal Metadata Format (SigMF)…
copyleft · top 15,000 on PyPI
neurokit2NeuroKit2 processes physiological signals (ECG,…
permissive · top 15,000 on PyPI
edn-formatReads and writes EDN (Extensible Data Notation)…
permissive · top 5,000 on PyPI
biocReads and writes biomedical text annotation…
permissive · top 15,000 on PyPI
fabioFabIO reads and writes 2D X-ray detector images…
permissive · top 15,000 on PyPI
neoNeo provides a unified data model for…
permissive · top 15,000 on PyPI
mne-bidsMNE-BIDS reads and writes neuroimaging datasets…
permissive · top 15,000 on PyPI
pyPPGAnalyzes finger photoplethysmogram (PPG)…
agpl · top 15,000 on PyPI