Python client for interacting with the PreEpiSeizures API.
This client simplifies access to authorized endpoints for researchers working with seizure-related data.
Install from PyPI:
pip install preepiseizures-api-client
from preepiseizures_api_client.client import PreEpiSeizuresDBClient
client = PreEpiSeizuresDBClient(
api_url="http://localhost:8000", # or your remote server URL
username="myusername",
password="mypassword"
)
Important: The seizure times stored in the database are aligned with hospital data and not guaranteed to be synchronized with wearable recordings.
There are two critical issues to be aware of:
-
Incorrect Wearable Timestamps:
Some sessions contain wearable files where the initial timestamp is incorrect (e.g., starts exactly at10:00:00
, which may be a placeholder or default value). -
No Guaranteed Synchronization:
Even when the wearable data has plausible timestamps, they are not guaranteed to be aligned with hospital data for the same session.
The patient codes for which the wearable timestamps are known to be reliable are: BLIW, BSEA, GPPF, OFUF, RGNI, UDZG, YIVL.
โ ๏ธ If you are comparing or aligning events between wearable and hospital data, you must implement a synchronization method (e.g., heart rate signal alignment).
The client handles authentication automatically:
- Authenticates with the provided username and password
- Requests a bearer token from the API
- Uses the token to authorize future requests
See the examples/example_query.py
file for a complete usage example.
Distributed under the MIT License. See LICENSE
for more information.
Created by Ana Sofia Carmo
Email: anascacais@gmail.com
GitHub: @anascacais