Skip to main content

library to read/write EDF+/BDF+ files

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyEDFlib-0.1.21.tar.gz (1.3 MB view details)

Uploaded Source

Built Distributions

pyEDFlib-0.1.21-cp39-cp39-win_amd64.whl (12.0 MB view details)

Uploaded CPython 3.9 Windows x86-64

pyEDFlib-0.1.21-cp39-cp39-win32.whl (11.9 MB view details)

Uploaded CPython 3.9 Windows x86

pyEDFlib-0.1.21-cp38-cp38-win_amd64.whl (11.9 MB view details)

Uploaded CPython 3.8 Windows x86-64

pyEDFlib-0.1.21-cp38-cp38-win32.whl (11.9 MB view details)

Uploaded CPython 3.8 Windows x86

pyEDFlib-0.1.21-cp37-cp37m-win_amd64.whl (11.9 MB view details)

Uploaded CPython 3.7m Windows x86-64

pyEDFlib-0.1.21-cp37-cp37m-win32.whl (11.9 MB view details)

Uploaded CPython 3.7m Windows x86

pyEDFlib-0.1.21-cp36-cp36m-win_amd64.whl (11.9 MB view details)

Uploaded CPython 3.6m Windows x86-64

pyEDFlib-0.1.21-cp36-cp36m-win32.whl (11.9 MB view details)

Uploaded CPython 3.6m Windows x86

File details

Details for the file pyEDFlib-0.1.21.tar.gz.

File metadata

  • Download URL: pyEDFlib-0.1.21.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for pyEDFlib-0.1.21.tar.gz
Algorithm Hash digest
SHA256 babad7c00d117790f41b352499e4e6d8b9600ef7926b8397c30f24e3a54d7369
MD5 63a303c8c8c4c5d93e856a12cb05d9ff
BLAKE2b-256 d4fec4be768f55dfdb98223082d579d28771d5faf3977f447673a1e6718f7d0f

See more details on using hashes here.

File details

Details for the file pyEDFlib-0.1.21-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pyEDFlib-0.1.21-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 12.0 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using 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

File hashes

Hashes for pyEDFlib-0.1.21-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 29cb4126e9fdab2d8db5fb972f0148121876b6cf2ca3903103803b55e5a037ff
MD5 b54159f5d119e9e2bed02342c7ca89b2
BLAKE2b-256 4afc8d74293f2fb729924753f0fcffe44c31f4f1260254d6ecf77a923b62c63d

See more details on using hashes here.

File details

Details for the file pyEDFlib-0.1.21-cp39-cp39-win32.whl.

File metadata

  • Download URL: pyEDFlib-0.1.21-cp39-cp39-win32.whl
  • Upload date:
  • Size: 11.9 MB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using 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

File hashes

Hashes for pyEDFlib-0.1.21-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 b39438ed68d8b86ac69742dd517611b868237c8cf22af2867c7486e0c2dfbeb9
MD5 535abb87d25c9d9e5e9f0da7cfa0f731
BLAKE2b-256 7868f14dde0b93637c3d64faae8c730d7a4ccad16d17b717bf4b06b6e68557f3

See more details on using hashes here.

File details

Details for the file pyEDFlib-0.1.21-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: pyEDFlib-0.1.21-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 11.9 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using 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

File hashes

Hashes for pyEDFlib-0.1.21-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 18f6ffc69cd8af63491c5c6edc62754d466681fca3c09cbde9bb9f1d20777e82
MD5 57960f53d5aa5ceaa617147d40f66e28
BLAKE2b-256 74ed6a623c965f0af9dee0c5fe8fca099c25166ec6e568b0975dd47a2c090b48

See more details on using hashes here.

File details

Details for the file pyEDFlib-0.1.21-cp38-cp38-win32.whl.

File metadata

  • Download URL: pyEDFlib-0.1.21-cp38-cp38-win32.whl
  • Upload date:
  • Size: 11.9 MB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using 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

File hashes

Hashes for pyEDFlib-0.1.21-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 c263574f550049572a40ffcce6b61c7a30a4f1f3c5f7842045520fcfc726cad3
MD5 8cd8e19eb1283b74948deddb24fa3255
BLAKE2b-256 b92f3444a6dceacaafac74294735ba5be912eccc7ba55d279e166e656356c12f

See more details on using hashes here.

File details

Details for the file pyEDFlib-0.1.21-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: pyEDFlib-0.1.21-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 11.9 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using 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

File hashes

Hashes for pyEDFlib-0.1.21-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 8634b8c87e9a379f0ccb98dc93f1dba557ec16eacd6c6b783f9428d6d2c46eaa
MD5 f903a06266d0b2f87654b67746e2c41f
BLAKE2b-256 b696ebe7c8e2f302e5353713fa41e11ecc240c73409152210907c0cc11d718da

See more details on using hashes here.

File details

Details for the file pyEDFlib-0.1.21-cp37-cp37m-win32.whl.

File metadata

  • Download URL: pyEDFlib-0.1.21-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 11.9 MB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using 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

File hashes

Hashes for pyEDFlib-0.1.21-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 7d46973e75ecda3bd64f22a3568ea2656710629f0dea76b441064417effed643
MD5 3db481b4c97312ffbde37048cbd49204
BLAKE2b-256 3531d2a497dffbd9a0e7adef0e52eeca5e983eba725f4a69904996d00392af67

See more details on using hashes here.

File details

Details for the file pyEDFlib-0.1.21-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: pyEDFlib-0.1.21-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 11.9 MB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using 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

File hashes

Hashes for pyEDFlib-0.1.21-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 ae56e37b570611a985df72571c43f98692144d37b5ecd87562f2bb6d60af5f5c
MD5 15126c6b21e1e9cae32b5391212b5a23
BLAKE2b-256 6098b37523fd1019d6933ad888075642b3b4c020225411388150d1aa337df780

See more details on using hashes here.

File details

Details for the file pyEDFlib-0.1.21-cp36-cp36m-win32.whl.

File metadata

  • Download URL: pyEDFlib-0.1.21-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 11.9 MB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using 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

File hashes

Hashes for pyEDFlib-0.1.21-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 5bea2ef4b3e7a31bec6cbdf4a6140991580f233322ca5c261642481e197d04b1
MD5 1d112d42eb9d73ec4e8e6476f969170c
BLAKE2b-256 19a674cfa8ca242b8b33dc97109dd0ae61ada9f609825e4c2c4b0d508759074f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page