A TUI to monitor, control and send synchronized events to multiple eye-trackers.
Project description
Pupil Labs pl-realtime-tui
A TUI to monitor, control and send synchronized events to multiple eye-trackers.
pl-realtime-tui is a Python-based Text User Interface (TUI) application designed to monitor, control, and send synchronized events to multiple Pupil Labs eye-trackers (Neon/Pupil Invisible). It leverages the pupil-labs-realtime-api for low-latency communication with devices and textual for a responsive terminal-based dashboard.
See the accompanying Alpha Lab article for more details and example use cases.
Installation
pip install pupil-labs-realtime-tui # or pip install git+https://github.com/pupil-labs/pl-realtime-tui.git
If you have UV installed. You can also run it as a one time:
uvx --from pupil-labs-realtime-tui pl-realtime-tui
or, if you want to run more than one time, you can install it as a tool.
uv tool install pupil-labs-realtime-tui
Run It
From there, you would be able to invoke it with just pl-realtime-tui from anywhere in the terminal, check out the -h help flag for other parameters.
[!IMPORTANT] Old terminals (e.g. macOS Terminal.app) do not support key-hold events, which can lead to performance issues when holding down event trigger keys. We attempt to bypass it by blocking new triggers during 0.3s, but key releases may not be detected. We recommend using modern terminals like WezTerm, Ghostty, Kitty, or Alacritty for the best experience. On those terminals, we will use Kitty protocol to detect key releases and support true key-hold events.
Related Work
We would like to also acknowledge the following published work using terminal-based interfaces for eye-tracking device management, concretely with our own devices:
Key Features
- Discovery: Implements both standard mDNS discovery and a "Deep Scan" (ARP-based or brute-force subnet scan).
- Device Dashboard: Displays connected devices in a
DataTablewith real-time status, battery, storage, and last event info. - Recording Control: Start/stop recordings on selected devices or all devices simultaneously.
- Event Triggers: Keyboard keys
0-9trigger events sent to either the selected device or all connected devices if none is selected. - Selection Logic: Clicking a device in the
DataTableselects it, allowing targeted start/stop/event commands. - Time Sync: Automatically estimates clock offsets periodically to maintain synchronization.
Tech Stack
- Language: Python (>=3.10, <4.0)
- TUI Framework: Textual
- CLI Framework: Typer
- API: pupil-labs-realtime-api
- Networking:
aiohttpfor HTTP API calls,scapyfor deep network scans (ARP).
Development Conventions
- Code Quality: Strictly follows PEP 8 via
ruff. Ensure all changes passmake checkbefore committing. - Typing: Uses static type hints throughout.
mypyis used for verification. - Asynchronous Code: Heavily relies on
asynciofor non-blocking I/O with multiple devices. Textual workers (@work) are used for long-running tasks like network discovery. - Time Synchronization: Uses
TimeOffsetEstimatorfrom the realtime API to calculate clock offsets between the host and eye-trackers, ensuring events are accurately timestamped in the device's clock domain. - UI Styling: Uses Textual CSS (
.tcss). Modifications to the UI look should be done insrc/pupil_labs/realtime_tui/css/main.tcss. - Pre-commit: Pre-commit hooks are configured to run linting and formatting on every commit.
Project details
Release history Release notifications | RSS feed
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 pupil_labs_realtime_tui-1.0.0.tar.gz.
File metadata
- Download URL: pupil_labs_realtime_tui-1.0.0.tar.gz
- Upload date:
- Size: 620.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e5fb29458b37de06148a756c263358c3630e7dec5d7134ca9b84a4bb547010c
|
|
| MD5 |
c03439f3766860c25a064aa15d20476b
|
|
| BLAKE2b-256 |
0eef615789b1db83bf3d0e31fcbae2e56d5d4497ef98cd13bb2628459c4156b3
|
Provenance
The following attestation bundles were made for pupil_labs_realtime_tui-1.0.0.tar.gz:
Publisher:
on-release-main.yml on pupil-labs/pl-realtime-tui
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pupil_labs_realtime_tui-1.0.0.tar.gz -
Subject digest:
0e5fb29458b37de06148a756c263358c3630e7dec5d7134ca9b84a4bb547010c - Sigstore transparency entry: 1325721177
- Sigstore integration time:
-
Permalink:
pupil-labs/pl-realtime-tui@94e5f6be4b71a42bca858ffa804494dfe98e290b -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/pupil-labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
on-release-main.yml@94e5f6be4b71a42bca858ffa804494dfe98e290b -
Trigger Event:
release
-
Statement type:
File details
Details for the file pupil_labs_realtime_tui-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pupil_labs_realtime_tui-1.0.0-py3-none-any.whl
- Upload date:
- Size: 25.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1db727b8a928a1412a4940fe265dd9d79a9f56003cc2dd66cce4ff895d2b0d75
|
|
| MD5 |
2b460e9e5a84e917ff194831f6b630df
|
|
| BLAKE2b-256 |
d31477537f4fb7fd3f5af229a7cfa9b17d6d2bf95270b1be9a861b880aa4cdef
|
Provenance
The following attestation bundles were made for pupil_labs_realtime_tui-1.0.0-py3-none-any.whl:
Publisher:
on-release-main.yml on pupil-labs/pl-realtime-tui
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pupil_labs_realtime_tui-1.0.0-py3-none-any.whl -
Subject digest:
1db727b8a928a1412a4940fe265dd9d79a9f56003cc2dd66cce4ff895d2b0d75 - Sigstore transparency entry: 1325721215
- Sigstore integration time:
-
Permalink:
pupil-labs/pl-realtime-tui@94e5f6be4b71a42bca858ffa804494dfe98e290b -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/pupil-labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
on-release-main.yml@94e5f6be4b71a42bca858ffa804494dfe98e290b -
Trigger Event:
release
-
Statement type: