This repository contains the epilepsy_tools Python package, which contains pre-written function to handle data from the various connected wearables used in the epilepsy research lab at CRCHUM.
The package is built with Python 3.10 and newer in mind, and will not work with older versions.
The list of required packages can be found in requirements.txt, and ahould be installed automatically when installing with the methods shown below
You can install the package from GitHub directly:
With uv (recommended):
# if the project is not initialized already
uv init my-project
cd my-project
uv add git+https://github.com/CRCHUM-Epilepsy-Group/epilepsy_tools.gitWith pip:
pip install git+https://github.com/CRCHUM-Epilepsy-Group/epilepsy_tools.gitDocumentation can be read here.
This is a quick example that loads data from a Cometa file (.c3d)
from epilepsy_tools import cometa
file_path = "some/directory/data.c3d"
data = cometa.load_data(file_path) # returns a pandas.DataFrame
recording_info = cometa.RecordingInfo.from_data(data)
emg_data = cometa.extract_emg_data(data) # returns a pandas.DataFrameThis lists the current devices that have functions implemented for them.
You can import the subpackage for the Cometa data with:
from epilepsy_tools import cometaIt uses the c3d package internally.
You can import the subpackage for the Hexoskin data with:
from epilepsy_tools import hexoskinIt uses the pyEDFlib package internally.
Enable logging for the module with:
import logging
logger = logging.getLogger("epilepsy_tools")
logger.setLevel(logging.DEBUG)
logger.addHandler(logging.StreamHandler())