Pywfdb is a Python module for accessing PhysioBank database of physiologic signals. It wraps WFDB library, providing easy, Object-Oriented interface.
Current, initial release of pywfdb is available for download:
pywfdb-0.1.0.zip
There is also precompiled binary version for Windows.
pywfdb-0.1.0.win32-py2.4.exe
If you want to instal pywfdb from source you need to download WFDB library source code. Direct link to the latest version is http://www.physionet.org/physiotools/wfdb-no-docs.tar.gz
After downloading you have to:
Unpack WFDB library files, preferably to pywfdb directory.
Configure WFDB library with --without-netfiles switch, for example:
./configure --without-netfiles --static --static_only --prefix=. --mandir=.
Edit paths in setup.py to point to WFDB lib source and header files. If You have unpacked files to wfdbpy directory, the defaults should work.
execute python setup.py script:
python setup.py install
Sample Python session with pywfdb may look like this:
>>> import pywfdb >>> record = pywfdb.Record("d:/mitdb/100") >>> print record.signal_names ('MLII', 'V5') >>> record.read('MLII', 1018, 5) # read 5 samples beggining from sample 1018 [-0.38, -0.375, -0.375, -0.375, -0.375] >>> annotation = record.annotation() >>> for ann in annotation.read(0, int(record.frequency) * 2): # read two first seconds ... print ann.time, ann.type, ann.typestr, ann.isqrs, ann.description ... 18 28 + False Rhythm change 77 1 N True Normal beat 370 1 N True Normal beat 662 1 N True Normal beat
See also module documentation generated from Pyrex source or check out some examples:
Pywfdb is licensed under GPL license.
If you need support, have improvement proposal or just using this library in your software, feel free to contect me directly.
Filip Wasilewski, <filipwasilewski@gmail.com>