skillfed

edfio

Read and write EDF/EDF+C/BDF/BDF+C files.

edfio v0.4.16 92.5K downloads/30d#13,445 on PyPI39
Permissive license Apache-2.0 Active released

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 edfio

uv

uv add edfio

poetry

poetry add edfio

Installing 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

License :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9

Tags

EDF file reader writerEDF+ format supportBDF biosemi filesphysiological signal formatEEG data file handlingbiomedical signal I/OEDF annotation support
biomedical-signalsfile-formateeg-data

More Scientific/Engineering packages