Pyxations
|
|
Pyxations is a Python library designed to analyze eye-tracking data, whether you are working with raw eye-tracking data or processed datasets. It helps researchers and developers extract useful insights from complex eye movements using Python's robust ecosystem.
Features
- Validated BIDS Conversion: Convert EyeLink, Tobii, GazePoint, and
webcam/WebGazer samples, tracker events, and behavioral tables to raw BIDS
while preserving the input folder verbatim under archival
sourcedata/. - EyeLink Import: Read EyeLink ASC exports directly, or accept EDF files by
first converting them with SR Research's
edf2ascutility. Pyxations then extracts messages, calibration reports, tracker events, and gaze samples from the resulting ASC data. - Trial Segmentation: Segment continuous eye-tracking data into trials using flexible methods, including start/end messages, fixed durations, or explicit start/end times.
- Behavioral Input Adapters: Normalize behavioral CSV, TSV, or standard
PsychoPy
New triallogs into BIDSevents.tsv, with source-independent column mapping and no PsychoPy runtime dependency. - Derivative Computation: Compute derivatives directly from the normalized raw BIDS dataset; the archived source files are not required at runtime.
- Analysis and Visualization: Load derivative tables through the experiment, subject, session, and trial hierarchy and generate gaze, scanpath, calibration, and task-specific plots.
- Eye Movement Detection: Use REMoDNaV, the Engbert–Kliegl implementation, or EyeLink-reported events.
- Saccades Direction Classification: Classify saccades based on their start and end coordinates into four primary directions: right, left, up, and down.
Requirements
Python 3.11or newer is required.- EyeLink EDF input requires the
edf2ascprogram from the EyeLink Developers Kit onPATH. Existing EyeLink ASC files can be read directly.
Dependencies
The base installation contains only the shared runtime stack:
numpypolarsmatplotlib
Feature-specific packages are optional:
pyxations[remodnav]adds REMoDNaV detection.pyxations[multimatch]adds MultiMatch scanpath comparison.pyxations[video]adds OpenCV-backed gaze animation, with optional video or image backgrounds.pyxations[all]installs all three feature groups.
Test and documentation tools are kept in optional dependency groups.
Canonical raw and derivative data are stored as compressed BIDS TSV/JSON, and the complete tabular pipeline uses Polars in memory.
Installation
Install the base package with uv or pip:
uv pip install pyxations
# or
pip install pyxations
Install only the features you use. The example below uses REMoDNaV:
pip install "pyxations[remodnav]"
For every optional feature:
pip install "pyxations[all]"
Documentation
Full documentation and API reference are available at https://neuroliaa.github.io/pyxations
Usage
Minimal example
import pyxations as pyx
# 1) Convert raw files to BIDS
bids_path = pyx.dataset_to_bids(
target_folder_path="path/to/output",
files_folder_path="path/to/source-recordings",
dataset_name="dataset_name",
format_name="eyelink",
task_name="visualsearch",
)
# 2) Compute derivatives using REMoDNaV
msg_keywords = ["begin", "end", "press"]
start_msgs = {"search": ["beginning_of_stimuli"]}
end_msgs = {"search": ["end_of_stimuli"]}
pyx.compute_derivatives_for_dataset(
bids_path,
dataset_format="eyelink",
detection_algorithm="remodnav",
msg_keywords=msg_keywords,
start_msgs=start_msgs,
end_msgs=end_msgs,
overwrite=True,
)
This produces two sibling, validator-tested BIDS datasets: the raw dataset and
dataset_name_derivatives. Canonical derivative samples and eye-movement
annotations are stored as compressed BIDS TSV.GZ files with JSON sidecars.
Pyxations reconstructs the same in-memory analysis tables when they are loaded.
Contributing
Contributions are welcome! Please check out the issues and submit a pull request if you'd like to help.
To develop locally
# Clone repository
git clone https://github.com/NeuroLIAA/pyxations.git
cd pyxations
# Create virtual environment and install
uv venv
uv pip install -e '.[dev]'
# To work on documentation
uv pip install -e '.[docs]'
License
This project is licensed under the MIT License.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyxations-0.4.0.tar.gz.
File metadata
- Download URL: pyxations-0.4.0.tar.gz
- Upload date:
- Size: 100.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8201c5e5251c9cc58d527ededdde5ecfcbe81f9d2602c0c2eb8a86d7a0dd4a0b
|
|
| MD5 |
921a5c867ddfb39f8c00c1787fb5d36d
|
|
| BLAKE2b-256 |
84af5461a3b937a0357c5c88486244250e12eb2038443ef9a4c85c88cb7f1cd1
|
Provenance
The following attestation bundles were made for pyxations-0.4.0.tar.gz:
Publisher:
release.yml on NeuroLIAA/pyxations
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyxations-0.4.0.tar.gz -
Subject digest:
8201c5e5251c9cc58d527ededdde5ecfcbe81f9d2602c0c2eb8a86d7a0dd4a0b - Sigstore transparency entry: 2444058785
- Sigstore integration time:
-
Permalink:
NeuroLIAA/pyxations@e28e08d9973db392d4f60ffb287537f00582a801 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/NeuroLIAA
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e28e08d9973db392d4f60ffb287537f00582a801 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pyxations-0.4.0-py3-none-any.whl.
File metadata
- Download URL: pyxations-0.4.0-py3-none-any.whl
- Upload date:
- Size: 112.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba47924610fb4f50aa4dcf5cc43b2ebf401d8206ce9e0bc34fb1ca16d308722c
|
|
| MD5 |
5d898ebd53a27f354087a428293a6aba
|
|
| BLAKE2b-256 |
c97b3af2122195ac96fbb09414cacfc814190dfa5fa5096e6cece8247334289e
|
Provenance
The following attestation bundles were made for pyxations-0.4.0-py3-none-any.whl:
Publisher:
release.yml on NeuroLIAA/pyxations
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyxations-0.4.0-py3-none-any.whl -
Subject digest:
ba47924610fb4f50aa4dcf5cc43b2ebf401d8206ce9e0bc34fb1ca16d308722c - Sigstore transparency entry: 2444059141
- Sigstore integration time:
-
Permalink:
NeuroLIAA/pyxations@e28e08d9973db392d4f60ffb287537f00582a801 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/NeuroLIAA
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e28e08d9973db392d4f60ffb287537f00582a801 -
Trigger Event:
release
-
Statement type: