Metadata-Version: 2.4
Name: tqrex
Version: 0.1.1
Summary: A progress bar that lets you play the Chrome T-Rex game in your terminal
Project-URL: Homepage, https://github.com/Samoilov2004/tqrex
Project-URL: Repository, https://github.com/Samoilov2004/tqrex
Project-URL: Issues, https://github.com/Samoilov2004/tqrex/issues
Project-URL: Changelog, https://github.com/Samoilov2004/tqrex/releases
Author: Mikhail Samoilov
License: MIT License
        
        Copyright (c) 2026 Mikhail Samoilov
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: cli,dinosaur,fun,game,progress,progress-bar,terminal,tqdm,trex
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Games/Entertainment :: Arcade
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Terminals
Classifier: Typing :: Typed
Requires-Python: >=3.11
Provides-Extra: dev
Requires-Dist: mypy>=1.11; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Description-Content-Type: text/markdown

# tqrex

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

![demo](demo.gif)

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` replacement** — `track()` 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

```bash
pip install tqrex
```

Or for local development:

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

---

## Quickstart

### Drop-in replacement for `tqdm`

```python
import tqrex
from playgress import track

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

### Any iterable works

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

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

### Manual control with the `Progress` context manager

```python
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

```python
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.