the-siesta-group / edfio

Read and write EDF/EDF+ files.
Apache License 2.0
25 stars 5 forks source link

edfio

Python PyPI conda-forge License Docs

Poetry Checked with mypy Ruff

edfio is a Python package for reading and writing EDF and EDF+C files.

It requires Python>=3.9 and NumPy>=1.22 and is available on PyPI:

pip install edfio

Features

Known limitations

Contributing

Contributions are welcome and highly appreciated. Check out the contributing guidelines to get started.

Usage

Further information is available in the API reference and usage examples.

To read an EDF from a file, use edfio.read_edf:

from edfio import read_edf

edf = read_edf("example.edf")

A new EDF can be created and written to a file as follows:

import numpy as np

from edfio import Edf, EdfSignal

edf = Edf(
    [
        EdfSignal(np.random.randn(30 * 256), sampling_frequency=256, label="EEG Fpz"),
        EdfSignal(np.random.randn(30), sampling_frequency=1, label="Body Temp"),
    ]
)
edf.write("example.edf")