# 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:
```bash
pip install edf-reader
```
For development installation:
```bash
git clone https://gitlab.com/bbeer_group/development/epycom/edf_reader.git
cd edf_reader
pip install -e .
```
## Usage
Basic usage example:
```python
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:
```bash
pip install -e .[dev]
```
Then run the tests using pytest:
```bash
pytest
```
Or use the provided test runner script:
```bash
./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
Raw data
{
"_id": null,
"home_page": "https://gitlab.com/bbeer_group/development/epycom/edf_reader",
"name": "edf-reader",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.12",
"maintainer_email": null,
"keywords": "edf, edf+, edf+d, european data format, eeg, medical, neuroscience",
"author": "Vojtech Travnicek",
"author_email": "Vojtech Travnicek <vojtech.travnicek@fnusa.cz>",
"download_url": "https://files.pythonhosted.org/packages/f3/fd/ad36a27c9431a2c5614516ac55fde031ed5fc595e5fef6e2707575a32d71/edf_reader-0.1.1.tar.gz",
"platform": null,
"description": "# EDF Reader\n\nA lightweight EDF (European Data Format) file reader for Python that can handle discontinuities in EDF+D files.\n\n## Description\n\nEDF 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.\n\nKey features:\n- Read EDF and EDF+D files\n- Parse file headers and signal information\n- Read signal data with time-based filtering\n- Handle annotations and discontinuities in EDF+D files\n- Optimized for performance with network drives\n\n## Installation\n\nYou can install the package using pip:\n\n```bash\npip install edf-reader\n```\n\nFor development installation:\n\n```bash\ngit clone https://gitlab.com/bbeer_group/development/epycom/edf_reader.git\ncd edf_reader\npip install -e .\n```\n\n## Usage\n\nBasic usage example:\n\n```python\nfrom edf_reader import EdfWrapper\n\n# Open an EDF file\nreader = EdfWrapper('/path/to/your/file.edf')\n\n# Get basic information about the channels\nchannel_info = reader.read_ts_channel_basic_info()\nprint(channel_info)\n\n# Read data from specific channels\n# The time range is specified in microseconds UTC (uutc)\n# [None, None] means the entire recording\ndata = reader.read_ts_channels_uutc(['Channel1', 'Channel2'], [None, None])\n\n# Check for discontinuities in the recording\ndiscontinuities = reader.get_discontinuities()\nprint(f\"Found {len(discontinuities)} discontinuities\")\n\n# Close the file when done\nreader.close()\n```\n\n## Testing\n\nThe package includes a comprehensive test suite using pytest. To run the tests, first install the development dependencies:\n\n```bash\npip install -e .[dev]\n```\n\nThen run the tests using pytest:\n\n```bash\npytest\n```\n\nOr use the provided test runner script:\n\n```bash\n./run_tests.py\n```\n\nThe tests use mocks to avoid requiring actual EDF files, making them fast and reliable to run in any environment.\n\n## License\n\nThis project is licensed under the BSD 3.0 License - see the LICENSE file for details.\n\n## Authors\n\n- Vojtech Travnicek - vojtech.travnicek@fnusa.cz, vojtech.travnicek@wavesurfers.science\n",
"bugtrack_url": null,
"license": "BSD-3-Clause",
"summary": "Lightweight EDF file reader, which can handle discontinuities.",
"version": "0.1.1",
"project_urls": {
"Homepage": "https://gitlab.com/bbeer_group/development/epycom/edf_reader"
},
"split_keywords": [
"edf",
" edf+",
" edf+d",
" european data format",
" eeg",
" medical",
" neuroscience"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "397cafec2cb19df7768ae1a875f73085829684b08ae1ab570c53bc98b80de282",
"md5": "08bd2644c3dbeae7a50582c110361253",
"sha256": "fc2c8fe96718ae201295d8a32a662f537ed9ae3c1791017e84a9ae420ce5e12d"
},
"downloads": -1,
"filename": "edf_reader-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "08bd2644c3dbeae7a50582c110361253",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.12",
"size": 8576,
"upload_time": "2025-07-31T11:42:40",
"upload_time_iso_8601": "2025-07-31T11:42:40.607419Z",
"url": "https://files.pythonhosted.org/packages/39/7c/afec2cb19df7768ae1a875f73085829684b08ae1ab570c53bc98b80de282/edf_reader-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "f3fdad36a27c9431a2c5614516ac55fde031ed5fc595e5fef6e2707575a32d71",
"md5": "ccfada899e774ec0ba857359732b11d8",
"sha256": "8f39b53a1bd39f841bcfde04642a9eb71605ef194689d6336e19e79ea5eca139"
},
"downloads": -1,
"filename": "edf_reader-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "ccfada899e774ec0ba857359732b11d8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.12",
"size": 14924,
"upload_time": "2025-07-31T11:42:41",
"upload_time_iso_8601": "2025-07-31T11:42:41.603496Z",
"url": "https://files.pythonhosted.org/packages/f3/fd/ad36a27c9431a2c5614516ac55fde031ed5fc595e5fef6e2707575a32d71/edf_reader-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-31 11:42:41",
"github": false,
"gitlab": true,
"bitbucket": false,
"codeberg": false,
"gitlab_user": "bbeer_group",
"gitlab_project": "development",
"lcname": "edf-reader"
}