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.22.tar.gz (1.3 MB view details)

Uploaded Source

Built Distributions

pyEDFlib-0.1.22-cp39-cp39-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.9 Windows x86-64

pyEDFlib-0.1.22-cp39-cp39-win32.whl (1.1 MB view details)

Uploaded CPython 3.9 Windows x86

pyEDFlib-0.1.22-cp38-cp38-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.8 Windows x86-64

pyEDFlib-0.1.22-cp38-cp38-win32.whl (1.1 MB view details)

Uploaded CPython 3.8 Windows x86

pyEDFlib-0.1.22-cp37-cp37m-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.7m Windows x86-64

pyEDFlib-0.1.22-cp37-cp37m-win32.whl (1.1 MB view details)

Uploaded CPython 3.7m Windows x86

pyEDFlib-0.1.22-cp36-cp36m-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.6m Windows x86-64

pyEDFlib-0.1.22-cp36-cp36m-win32.whl (1.1 MB view details)

Uploaded CPython 3.6m Windows x86

File details

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

File metadata

  • Download URL: pyEDFlib-0.1.22.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.22.tar.gz
Algorithm Hash digest
SHA256 a78dc945e631f33a490d790aed5f70a7f23ae8bd54d1ef19de9ddd0eee796d94
MD5 e4158294948f4c6bba5f6ddae7347e83
BLAKE2b-256 6432d70313f001a4c1494c5761b37836054239de428539dd7c76c20f108a610a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyEDFlib-0.1.22-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 1.2 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.22-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 b61c68e78d63f494ef287354912b94543ab03a7682d257514bd41ed522e036ee
MD5 a6e0b64c7d3454dd7d1aac4de97220aa
BLAKE2b-256 6242e7fdf3b329ef045e8ff3bff0c2af79d94564412576f3d11f04ff5ec52d30

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyEDFlib-0.1.22-cp39-cp39-win32.whl
  • Upload date:
  • Size: 1.1 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.22-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 dbf1d6983d09e6a425dc572d6674f83539cc26502f1cd362d12975c6f53d3174
MD5 75d3c71a141ddda5533f490387ab9fee
BLAKE2b-256 fa2f44bb549a65f2b75ea797f0f891f29779ded1f007a69300646a6e2c1770d3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyEDFlib-0.1.22-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 1.1 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.22-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 bdfc9ba714da4db139e3209960504344f396f91af02bd4c5b8948c1a214f642d
MD5 51822557dc8463ad74f784f79c949b0b
BLAKE2b-256 589c0d388d8d913a88b60b2d66727c05cdd1e1840b6f65928f3910dc0902ba67

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyEDFlib-0.1.22-cp38-cp38-win32.whl
  • Upload date:
  • Size: 1.1 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.22-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 7a0dd830ae983f58d4cf0a8e59ff98208f3e475b970fcdb9fd6775608653c53c
MD5 fbaac00afbc20c09c73f3ae9adb05403
BLAKE2b-256 d84f4df1045b9bb39d2c4ae42d9915e958431cc0b605f5828a653aa9488fabca

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyEDFlib-0.1.22-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 1.1 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.22-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 4eeef47b8b60f578fd585b9bdd9432717382505f61997cf8272f8c6c7a7f8d42
MD5 b99c1a75d57e62743974ce8fa111e767
BLAKE2b-256 6f071c18417d116d6976e1727b5eb62c75a3937564c950887266947b066907ec

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyEDFlib-0.1.22-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 1.1 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.22-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 ee921b235225bfa9d7599228c33c5789746e227bb72b08fffb7539e35f82fb79
MD5 e4db82643b37d5eb29f6a1a49aa2612a
BLAKE2b-256 3500d40a8ec36131cd4b372a604eab2bfec07a97c1358739ec2b49c47e896f3c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyEDFlib-0.1.22-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 1.1 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.22-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 2167129b865f3940d0ce3cce3b28f80970b8d7189098ac545df10d5902204fa3
MD5 1347e2b59e0f741f52bba885ed98c8eb
BLAKE2b-256 fb5a4aad8b3dd9f872c5bb8cf07dca0a52e6e10be89d9029dc26166e19fbf606

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyEDFlib-0.1.22-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 1.1 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.22-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 f10c73b6a7c7306beaa431cb96acc513760f95818b38cba71ca796021ae58e30
MD5 a2b407240c393d39de31f5c5bd3189ff
BLAKE2b-256 d5a9dd08d4c5e278b62244089706dd965ddf3b63bc56db3dd3a39360210b5e6c

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