--- id: edfio version: "0.4.16" license: Apache-2.0 license_treatment: permissive maintenance: active --- # edfio — Read and write EDF/EDF+C/BDF/BDF+C files. License: permissive · Maintenance: active · Downloads: 92.5K/mo ## 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 above — 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 pip install edfio uv add edfio 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_current - Install friction: low - Maintenance: active - Downloads: 92.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags EDF file reader writer, EDF+ format support, BDF biosemi files, physiological signal format, EEG data file handling, biomedical signal I/O, EDF annotation support, biomedical-signals, file-format, eeg-data [View on SkillFed](https://skillfed.io/packages/edfio) · [View on PyPI](https://pypi.org/project/edfio/)