Skip to main content

A TUI to monitor, control and send synchronized events to multiple eye-trackers.

Project description

Pupil Labs pl-realtime-tui

ci documentation uv ruff pre-commit pypi version python version

pl-realtime-tui banner

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 DataTable with 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-9 trigger events sent to either the selected device or all connected devices if none is selected.
  • Selection Logic: Clicking a device in the DataTable selects 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: aiohttp for HTTP API calls, scapy for deep network scans (ARP).

Development Conventions

  • Code Quality: Strictly follows PEP 8 via ruff. Ensure all changes pass make check before committing.
  • Typing: Uses static type hints throughout. mypy is used for verification.
  • Asynchronous Code: Heavily relies on asyncio for non-blocking I/O with multiple devices. Textual workers (@work) are used for long-running tasks like network discovery.
  • Time Synchronization: Uses TimeOffsetEstimator from 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 in src/pupil_labs/realtime_tui/css/main.tcss.
  • Pre-commit: Pre-commit hooks are configured to run linting and formatting on every commit.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pupil_labs_realtime_tui-1.0.0.tar.gz (620.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pupil_labs_realtime_tui-1.0.0-py3-none-any.whl (25.4 kB view details)

Uploaded Python 3

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

Hashes for pupil_labs_realtime_tui-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0e5fb29458b37de06148a756c263358c3630e7dec5d7134ca9b84a4bb547010c
MD5 c03439f3766860c25a064aa15d20476b
BLAKE2b-256 0eef615789b1db83bf3d0e31fcbae2e56d5d4497ef98cd13bb2628459c4156b3

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pupil_labs_realtime_tui-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pupil_labs_realtime_tui-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1db727b8a928a1412a4940fe265dd9d79a9f56003cc2dd66cce4ff895d2b0d75
MD5 2b460e9e5a84e917ff194831f6b630df
BLAKE2b-256 d31477537f4fb7fd3f5af229a7cfa9b17d6d2bf95270b1be9a861b880aa4cdef

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page