Lightweight EDF file reader, which can handle discontinuities.
Project description
EDF Reader
A lightweight EDF (European Data Format) file reader for Python that can handle discontinuities in EDF+D files.
Description
EDF Reader is a Python package for reading EDF (European Data Format) files, which are commonly used for storing medical/biological signals like EEG data. This implementation is optimized for performance, especially when reading files over network drives, and can handle discontinuities in EDF+D format files.
Key features:
- Read EDF and EDF+D files
- Parse file headers and signal information
- Read signal data with time-based filtering
- Handle annotations and discontinuities in EDF+D files
- Optimized for performance with network drives
Installation
You can install the package using pip:
pip install edf-reader
For development installation:
git clone https://gitlab.com/bbeer_group/development/epycom/edf_reader.git
cd edf_reader
pip install -e .
Usage
Basic usage example:
from edf_reader import EdfWrapper
# Open an EDF file
reader = EdfWrapper('/path/to/your/file.edf')
# Get basic information about the channels
channel_info = reader.read_ts_channel_basic_info()
print(channel_info)
# Read data from specific channels
# The time range is specified in microseconds UTC (uutc)
# [None, None] means the entire recording
data = reader.read_ts_channels_uutc(['Channel1', 'Channel2'], [None, None])
# Check for discontinuities in the recording
discontinuities = reader.get_discontinuities()
print(f"Found {len(discontinuities)} discontinuities")
# Close the file when done
reader.close()
Testing
The package includes a comprehensive test suite using pytest. To run the tests, first install the development dependencies:
pip install -e .[dev]
Then run the tests using pytest:
pytest
Or use the provided test runner script:
./run_tests.py
The tests use mocks to avoid requiring actual EDF files, making them fast and reliable to run in any environment.
License
This project is licensed under the BSD 3.0 License - see the LICENSE file for details.
Authors
- Vojtech Travnicek - vojtech.travnicek@fnusa.cz, vojtech.travnicek@wavesurfers.science
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file edf_reader-0.1.3.tar.gz.
File metadata
- Download URL: edf_reader-0.1.3.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bcf62a341d2c4f4cea0254ae49d3a1b4a10c4193625d554d79cabdb5631edbd9
|
|
| MD5 |
3d5b98620bb41fcc1a3b3b8c4243585a
|
|
| BLAKE2b-256 |
542bb7917d991d8bd5da2311f49fdaee4fbaa1007f24de13f2c4b1fe2c014ae8
|
File details
Details for the file edf_reader-0.1.3-py3-none-any.whl.
File metadata
- Download URL: edf_reader-0.1.3-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5ba493f6741037ef68634059b1a4750cc4a991e77741ace6250fd3474f3a738
|
|
| MD5 |
adc32435c39c076206589a4f9f9a425c
|
|
| BLAKE2b-256 |
c3d7b6f95f2dac7229cf060c33713e3366eb5399edfe48aedbcf04ca913706a8
|