Registry / data / pyedflib

pyedflib

JSON →
library0.1.42pypypi✓ verified 87d ago

A Python library to read and write EDF+/BDF+ files, commonly used for biomedical signal data (e.g., EEG, ECG). Current version 0.1.42. Low release cadence, maintenance mode.

pip install pyedflib
INSTALL
IMPORT
SIG · PYEDFLIB
P
pyedflib
datapythonv0.1.42
Install
3.9s avg
Import
288ms
Disk
102MB
Pass rate
8/ 10
Env Coverage8 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.42 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 4s
py 3.11
✓ —
✓ 3.7s
py 3.12
✓ —
✓ 3.5s
py 3.13
✕ build_error
✕ build_error
py 3.9
✓ —
✓ 4.5s
102MB installed
● package 102MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

EdfReader
from pyedflib import EdfReader
import pyedflib.EdfReader
EdfReader is a class, not a module.
EdfWriter
from pyedflib import EdfWriter
Common mistake: trying to import EdfWriter from the wrong submodule.
highlevel
from pyedflib import highlevel
import pyedflib.highlevel
highlevel is a submodule; use from pyedflib import highlevel.

Basic read/write of EDF+ files with pyedflib.

from pyedflib import EdfReader, EdfWriter import numpy as np # Read an EDF file reader = EdfReader('example.edf') signal = reader.readSignal(0) print(f'Signal length: {len(signal)}') reader.close() # Write an EDF file writer = EdfWriter('output.edf', n_channels=1, file_type=1) # EDF+ type: 1=EDF, 0=BDF writer.setSignalHeader(0, label='ECG', dimension='mV', sample_rate=256, physical_min=-5, physical_max=5, digital_min=-32768, digital_max=32767) data = np.sin(np.linspace(0, 10, 2560)) writer.writeSamples([data]) writer.close()
Debug
Known issues
breakingIn v0.1.38, pyedflib dropped support for Python <3.8 and numpy <2.0. Ensure your environment uses Python 3.8+.
fix
Upgrade to pyedflib >=0.1.38 and use Python 3.8+.
affects: <0.1.38
deprecatedThe parameter `sample_rate` in `setSignalHeader` is deprecated since v0.1.39. Use `sample_frequency` instead.
fix
Replace `sample_rate` with `sample_frequency` in `setSignalHeader` calls.
affects: >=0.1.39
gotchaWhen writing EDF files, `physical_min` and `physical_max` are no longer strictly asserted (since v0.1.39). Incorrect values may produce warnings but still write, potentially corrupting data.
fix
Ensure physical_min and physical_max correctly represent the expected signal range.
affects: >=0.1.39
gotchaThe `readSignal` method returns a numpy array; indexing and handling differ from raw digital values. Be aware of the scaling applied.
fix
Refer to documentation for signal scaling details.
affects: all
Errors
Common errors & fixes
FileNotFoundError: [Errno 2] No such file or directory: 'example.edf'
File path does not exist or is relative to the wrong directory.
fix
Use an absolute path or ensure the current working directory is correct.
ValueError: The physical_min and physical_max values are too small. The scaling factor is too large.
Previous versions (pre-0.1.39) raised an error for extreme physical ranges.
fix
Set physical_min and physical_max to reasonable values matching the signal amplitude, or upgrade to >=0.1.39 which only warns.
ImportError: cannot import name 'EdfReader' from 'pyedflib'
Trying to import from the wrong module or an older version of pyedflib.
fix
Use `from pyedflib import EdfReader` and ensure version >=0.1.0.
Upgrade
Version history
0.1.42latest on PyPI · released Jun 26, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
pyedflib — pip install pyedflib · libregistry