Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added high-level functions #65

Merged
merged 26 commits into from
Feb 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,33 @@ 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.

.. code-block:: Python

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 and anonymize
highlevel.drop_channels('edf_file.edf', to_drop=['ch2', 'ch4'])
highlevel.anonymize('edf_file.edf')


License
-------

Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ install:
- "util\\appveyor\\build.cmd %PYTHON%\\python.exe -m pip install
numpy --cache-dir c:\\tmp\\pip-cache"
- "util\\appveyor\\build.cmd %PYTHON%\\python.exe -m pip install
Cython nose coverage matplotlib --cache-dir c:\\tmp\\pip-cache"
Cython nose coverage matplotlib dateparser tqdm --cache-dir c:\\tmp\\pip-cache"

test_script:
- "util\\appveyor\\build.cmd %PYTHON%\\python.exe setup.py build --build-lib build\\lib\\"
Expand Down
2 changes: 1 addition & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ dependencies:
- sudo apt-get install texlive-fonts-recommended
- pip install -q --install-option="--no-cython-compile" Cython==0.23.4
- pip install -q numpy
- pip install -q nose mpmath argparse Pillow codecov matplotlib Sphinx==1.5.5
- pip install -q nose mpmath argparse Pillow codecov matplotlib Sphinx==1.5.5 tqdm
- git submodule init
- git submodule update
- python setup.py build
Expand Down
1 change: 1 addition & 0 deletions pyedflib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from ._extensions._pyedflib import *
from .edfwriter import *
from .edfreader import *
from . import highlevel

from . import data

Expand Down
Loading