Skip to main content

A progress bar that lets you play the Chrome T-Rex game in your terminal

Project description

tqrex

A progress bar that lets you play the Chrome T-Rex game in your terminal.

demo

Your long-running script doesn't have to be boring. tqrex wraps any iterable in a full T-Rex side-scroller — jump cacti, dodge birds, rack up a high score — while your real work happens in the background. When the task finishes the game keeps running until you decide to quit.


Features

  • Zero runtime dependencies — pure Python standard library
  • Drop-in tqdm replacementtrack() has the same call signature
  • Progress context manager — for manual update control
  • 60 FPS physics — faithful gravity, jump arc, and speed curve from the original Chrome dino
  • Autoplay AI — built-in geometric look-ahead controller (autoplay=True)
  • Double-buffered renderer — flicker-free diff-based redraw, single write per frame
  • Cross-platform — macOS, Linux, Windows (ANSI terminal required)
  • Python 3.11+

Installation

pip install tqrex

Or for local development:

git clone https://github.com/mikhail-samoilov/tqrex
cd tqrex
pip install -e ".[dev]"

Quickstart

Drop-in replacement for tqdm

import tqrex
from playgress import track

for item in track(range(100), description="Processing"):
    tqrex.sleep(0.05)

Any iterable works

files = ["data_001.csv", "data_002.csv", ...]

for f in track(files, description="Crunching files"):
    crunch(f)

Manual control with the Progress context manager

from playgress import Progress

steps = ["Download", "Extract", "Build", "Install"]
with Progress(total=len(steps), description="Installing") as p:
    for step in steps:
        p.set_description(f"Step: {step}")
        run(step)
        p.update(1)

Let the AI play for you

for epoch in track(range(200), description="Training", autoplay=True):
    train_one_epoch(epoch)

Keyboard controls

Key Action
Space / Jump
Duck on ground / fast-drop mid-air
R Restart after game-over; replay after task completes
Q / Ctrl-C Quit — unblocks the script

Note: The game keeps running after all items are processed so you can finish your current run. Press Q when you're done.

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

tqrex-0.1.1.tar.gz (543.5 kB view details)

Uploaded Source

Built Distribution

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

tqrex-0.1.1-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file tqrex-0.1.1.tar.gz.

File metadata

  • Download URL: tqrex-0.1.1.tar.gz
  • Upload date:
  • Size: 543.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for tqrex-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4b2c35d14d4eddeb9ebbb49501181db726447bfee24ce2f11b251a18fbdc65ea
MD5 40e40e630c3d86a909e1d33aa95b5505
BLAKE2b-256 dfa83e9f7e67becacd6199db74b8ee43c9fde306af6cc96e35fa583ab63f87e3

See more details on using hashes here.

File details

Details for the file tqrex-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tqrex-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for tqrex-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bc8e1726853a16398f38e2be653970367745720c173f9f2e0f232868eb4ae9a8
MD5 5368af82e08219b335259a5a45821d2b
BLAKE2b-256 ba45686c9c3953ff015c2227ea230ed8dabd9e3dd8bc5893d63fe276753f8fb9

See more details on using hashes here.

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