Skip to main content

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.

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.1.tar.gz (621.2 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.1-py3-none-any.whl (26.0 kB view details)

Uploaded Python 3

File details

Details for the file pupil_labs_realtime_tui-1.0.1.tar.gz.

File metadata

  • Download URL: pupil_labs_realtime_tui-1.0.1.tar.gz
  • Upload date:
  • Size: 621.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pupil_labs_realtime_tui-1.0.1.tar.gz
Algorithm Hash digest
SHA256 424f2547fbc4d388c0877ce09358cf083391603fc66ca0decbcd4451b930f0ee
MD5 ee8b1aa4c28a64e5c058975b245ba4e3
BLAKE2b-256 b04c12c92eb30a42b36e012531c8bd5f842ccc74e0ece7eb7a1441065f01370a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pupil_labs_realtime_tui-1.0.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pupil_labs_realtime_tui-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6c54807a380cfee0b5abb8291ebb0cbdda0f9c8b5784c422064e6a6546159662
MD5 af97d16a01d98ff6b2fe8fcf702090c6
BLAKE2b-256 1d8fd164d1e72f1c0f3fa26151b6141dbeba1ae05828fa8da1828ec6f1dba9be

See more details on using hashes here.

Provenance

The following attestation bundles were made for pupil_labs_realtime_tui-1.0.1-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.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page