Skip to main content
https://codecov.io/gh/holgern/pyedflib/branch/master/graph/badge.svg https://travis-ci.com/holgern/pyedflib.svg?branch=master https://ci.appveyor.com/api/projects/status/49wwigslgtj288q1?svg=true https://readthedocs.org/projects/pyedflib/badge/?version=latest https://api.codacy.com/project/badge/Grade/a80bc8bdb6a342be83b9d03138bfd078 https://anaconda.org/conda-forge/pyedflib/badges/installer/conda.svg https://anaconda.org/conda-forge/pyedflib/badges/version.svg https://anaconda.org/conda-forge/pyedflib/badges/downloads.svg

What is pyEDFlib

pyEDFlib is a python library to read/write EDF+/BDF+ files based on EDFlib.

EDF means European Data Format and was firstly published Kemp1992. In 2003, an improved version of the file protokoll named EDF+ has been published and can be found at Kemp2003.

The EDF/EDF+ format saves all data with 16 Bit. A version which saves all data with 24 Bit, was introduces by the compony BioSemi.

The definition of the EDF/EDF+/BDF/BDF+ format can be found under edfplus.info.

This python toolbox is a fork of the toolbox from Christopher Lee-Messer and uses the EDFlib from Teunis van Beelen. The EDFlib is able to read and write EDF/EDF+/BDF/BDF+ files.

Documentation

Documentation is available online at http://pyedflib.readthedocs.org.

Installation

pyEDFlib can be used with Python >=3.5. It depends on the Numpy package. To use the newest source code from git, you have to download the source code. You need a C compiler and a recent version of Cython. Go then to the source directory and type:

python setup.py build
python setup.py install

There are binary wheels which can be installed by (use pip3 when available):

pip install pyEDFlib

Users of the Anaconda Python distribution can directly obtain pre-built Windows, Intel Linux or macOS / OSX binaries from the conda-forge channel. This can be done via:

conda install -c conda-forge pyedflib

The most recent development version can be found on GitHub at https://github.com/holgern/pyedflib.

The latest release, including source and binary packages for Linux, macOS and Windows, is available for download from the Python Package Index. You can find source releases at the Releases Page.

Highlevel interface

pyEDFlib includes an highlevel interface for easy access to read and write edf files. Additionally functionality as anonymizing, dropping or renaming channels can be found there.

from pyedflib import highlevel

# write an edf file
signals = np.random.rand(5, 256*300)*200 # 5 minutes of random signal
channel_names = ['ch1', 'ch2', 'ch3', 'ch4', 'ch5']
signal_headers = highlevel.make_signal_headers(channel_names, sample_rate=256)
header = highlevel.make_header(patientname='patient_x', gender='Female')
highlevel.write_edf('edf_file.edf', signals, signal_headers, header)

# read an edf file
signals, signal_headers, header = highlevel.read_edf('edf_file.edf')
print(signal_headers[0]['sample_rate']) # prints 256

# drop a channel from the file or anonymize edf
highlevel.drop_channels('edf_file.edf', to_drop=['ch2', 'ch4'])
highlevel.anonymize_edf('edf_file.edf', new_file='anonymized.edf'
                             to_remove=['patientname', 'birthdate'],
                             new_values=['anonymized', ''])
# check if the two files have the same content
highlevel.compare_edf('edf_file.edf', 'anonymized.edf')
# change polarity of certain channels
highlevel.change_polarity('file.edf', channels=[1,3])
# rename channels within a file
highlevel.rename_channels('file.edf', mapping={'C3-M1':'C3'})

License

pyEDFlib is a free Open Source software released under the BSD 2-clause license.

Releases can be cited via Zenodo.

https://zenodo.org/badge/42585968.svg

Release files for pyEDFlib 0.1.21

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyEDFlib 0.1.21
File Size Uploaded
pyEDFlib-0.1.21.tar.gz 1.3 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for pyEDFlib 0.1.21
File
pyEDFlib-0.1.21-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
pyEDFlib-0.1.21-cp39-cp39-win32.whl CPython 3.9 CPython 3.9 Windows x86-32 Details
pyEDFlib-0.1.21-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
pyEDFlib-0.1.21-cp38-cp38-win32.whl CPython 3.8 CPython 3.8 Windows x86-32 Details
pyEDFlib-0.1.21-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details
pyEDFlib-0.1.21-cp37-cp37m-win32.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-32 Details
pyEDFlib-0.1.21-cp36-cp36m-win_amd64.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-64 Details
pyEDFlib-0.1.21-cp36-cp36m-win32.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-32 Details

Total release size: 96.8 MB

Release files / pyEDFlib-0.1.21.tar.gz

Download URL pyEDFlib-0.1.21.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
babad7c00d117790f41b352499e4e6d8b9600ef7926b8397c30f24e3a54d7369
BLAKE2b-256 checksum
How to use checksums
d4fec4be768f55dfdb98223082d579d28771d5faf3977f447673a1e6718f7d0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.6.0.post20201009 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.3

Release files / pyEDFlib-0.1.21-cp39-cp39-win_amd64.whl

Download URL pyEDFlib-0.1.21-cp39-cp39-win_amd64.whl
Size 12.0 MB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
29cb4126e9fdab2d8db5fb972f0148121876b6cf2ca3903103803b55e5a037ff
BLAKE2b-256 checksum
How to use checksums
4afc8d74293f2fb729924753f0fcffe44c31f4f1260254d6ecf77a923b62c63d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.6.0.post20201009 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.3

Release files / pyEDFlib-0.1.21-cp39-cp39-win32.whl

Download URL pyEDFlib-0.1.21-cp39-cp39-win32.whl
Size 11.9 MB
Tags CPython 3.9 Windows x86-32
SHA-256 checksum
How to use checksums
b39438ed68d8b86ac69742dd517611b868237c8cf22af2867c7486e0c2dfbeb9
BLAKE2b-256 checksum
How to use checksums
7868f14dde0b93637c3d64faae8c730d7a4ccad16d17b717bf4b06b6e68557f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.6.0.post20201009 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.3

Release files / pyEDFlib-0.1.21-cp38-cp38-win_amd64.whl

Download URL pyEDFlib-0.1.21-cp38-cp38-win_amd64.whl
Size 11.9 MB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
18f6ffc69cd8af63491c5c6edc62754d466681fca3c09cbde9bb9f1d20777e82
BLAKE2b-256 checksum
How to use checksums
74ed6a623c965f0af9dee0c5fe8fca099c25166ec6e568b0975dd47a2c090b48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.6.0.post20201009 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.3

Release files / pyEDFlib-0.1.21-cp38-cp38-win32.whl

Download URL pyEDFlib-0.1.21-cp38-cp38-win32.whl
Size 11.9 MB
Tags CPython 3.8 Windows x86-32
SHA-256 checksum
How to use checksums
c263574f550049572a40ffcce6b61c7a30a4f1f3c5f7842045520fcfc726cad3
BLAKE2b-256 checksum
How to use checksums
b92f3444a6dceacaafac74294735ba5be912eccc7ba55d279e166e656356c12f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.6.0.post20201009 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.3

Release files / pyEDFlib-0.1.21-cp37-cp37m-win_amd64.whl

Download URL pyEDFlib-0.1.21-cp37-cp37m-win_amd64.whl
Size 11.9 MB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
8634b8c87e9a379f0ccb98dc93f1dba557ec16eacd6c6b783f9428d6d2c46eaa
BLAKE2b-256 checksum
How to use checksums
b696ebe7c8e2f302e5353713fa41e11ecc240c73409152210907c0cc11d718da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.6.0.post20201009 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.3

Release files / pyEDFlib-0.1.21-cp37-cp37m-win32.whl

Download URL pyEDFlib-0.1.21-cp37-cp37m-win32.whl
Size 11.9 MB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
7d46973e75ecda3bd64f22a3568ea2656710629f0dea76b441064417effed643
BLAKE2b-256 checksum
How to use checksums
3531d2a497dffbd9a0e7adef0e52eeca5e983eba725f4a69904996d00392af67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.6.0.post20201009 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.3

Release files / pyEDFlib-0.1.21-cp36-cp36m-win_amd64.whl

Download URL pyEDFlib-0.1.21-cp36-cp36m-win_amd64.whl
Size 11.9 MB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
ae56e37b570611a985df72571c43f98692144d37b5ecd87562f2bb6d60af5f5c
BLAKE2b-256 checksum
How to use checksums
6098b37523fd1019d6933ad888075642b3b4c020225411388150d1aa337df780
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.6.0.post20201009 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.3

Release files / pyEDFlib-0.1.21-cp36-cp36m-win32.whl

Download URL pyEDFlib-0.1.21-cp36-cp36m-win32.whl
Size 11.9 MB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
5bea2ef4b3e7a31bec6cbdf4a6140991580f233322ca5c261642481e197d04b1
BLAKE2b-256 checksum
How to use checksums
19a674cfa8ca242b8b33dc97109dd0ae61ada9f609825e4c2c4b0d508759074f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.6.0.post20201009 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.3
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page