Terminal higher-or-lower NBA game scaffold
Project description
Hoop Higher 🏀
A modern terminal-based game inspired by "Higher or Lower", utilizing real NBA player point totals. Built natively with Python and Textual to provide a sleek, fast, and responsive TUI experience.
Features ✨
- Multiple Game Modes:
- Endless: Keep playing and building your score multiplier. Wrong answers deduct points, but don't end the game!
- Arcade: Strive for perfection. One wrong answer and your run is over.
- Historical: Journey back in time! Play rounds using real NBA game data sampled from random historical dates across defined eras.
- Live & Cached NBA Data: Seamlessly interfaces with the real NBA stats API, falling back on an intelligent SQLite-backed caching layer for speed and resilience.
- Fast & Tactile UI: A beautiful TUI architecture built with
Textual, featuring keyboard shortcuts, fluid layouts, and immediate visual feedback. - Local Leaderboards: Track your high scores, best streaks, and overall stats locally via SQLModel and SQLite.
Tech Stack 🛠️
- Language: Python 3.13+
- TUI Framework: Textual
- Database: SQLite
- ORM: SQLModel
- HTTP Client:
httpxandnba_api - Configuration:
pydantic-settings - Package Manager:
uv - Testing:
pytest
Installation and Setup 🚀
-
Clone the repository:
git clone https://github.com/Davi-Gurgel/hoop-higher.git cd hoop-higher
-
Set up the virtual environment using
uv:uv venv source .venv/bin/activate
-
Install dependencies:
uv sync --all-groups
-
Run the game:
uv run hoophigher
Install from PyPI 📦
Once published, you can run Hoop Higher without cloning the repo.
- Run with
uvx(ephemeral):uvx hoop-higher - Install with
pipx(persistent):pipx install hoop-higher hoop-higher
Configuration ⚙️
Customize the app's behavior by overriding these environment variables (all prefixed with HOOPHIGHER_):
HOOPHIGHER_STATS_PROVIDERnba_api(default): Uses real NBA data with a SQLite caching layer.mock: Uses pre-populated mock data for incredibly fast local development and testing.
HOOPHIGHER_HISTORICAL_START_YEAR(default:2010)HOOPHIGHER_HISTORICAL_END_YEAR(default:2020)HOOPHIGHER_HISTORICAL_ROUNDS(default:5)HOOPHIGHER_NBA_API_TIMEOUT_SECONDS(default:20)
Note: Historical mode intelligently probes and samples available games on the fly, avoiding massive initial database syncs and ensuring a fast start.
Local Development & Testing 🧪
Code quality, formatting, and tests are heavily utilized in this repository.
- Run all tests:
uv run pytest
- Linting & Formatting: (via ruff)
uv run ruff check src tests
Publishing to PyPI 🛰️
This repository includes automated publishing via GitHub Actions in .github/workflows/publish.yml.
- Create your package on PyPI (first time only) and configure a Trusted Publisher pointing to this repository and workflow.
- Bump
versioninpyproject.toml. - Create and push a version tag (must match
v*):git tag v0.1.0 git push origin v0.1.0
After the workflow succeeds, users can run uvx hoop-higher or pipx install hoop-higher.
For more architectural guidelines and decisions, view ARCHITECTURE.md and AGENTS.md.
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 hoop_higher-0.1.0.tar.gz.
File metadata
- Download URL: hoop_higher-0.1.0.tar.gz
- Upload date:
- Size: 56.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 |
c5e8d724170e785ddf80df4630efa03eac94decd9d092e325e3a6b25e350bbd3
|
|
| MD5 |
837219b53c97943702ec48632de724d0
|
|
| BLAKE2b-256 |
c81f48f74b210b1eaa460657a0b8db7299f04a75e85100cca4be5449bcada262
|
Provenance
The following attestation bundles were made for hoop_higher-0.1.0.tar.gz:
Publisher:
publish.yml on Davi-Gurgel/hoop-higher
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hoop_higher-0.1.0.tar.gz -
Subject digest:
c5e8d724170e785ddf80df4630efa03eac94decd9d092e325e3a6b25e350bbd3 - Sigstore transparency entry: 1342815022
- Sigstore integration time:
-
Permalink:
Davi-Gurgel/hoop-higher@fb84fd12be8881dddc3904e4f3987e2c2a1e9468 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Davi-Gurgel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@fb84fd12be8881dddc3904e4f3987e2c2a1e9468 -
Trigger Event:
push
-
Statement type:
File details
Details for the file hoop_higher-0.1.0-py3-none-any.whl.
File metadata
- Download URL: hoop_higher-0.1.0-py3-none-any.whl
- Upload date:
- Size: 49.9 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 |
520e98ba9e7451e107cddd74b78671fd5302be76352dc7ed9250379eb500adcb
|
|
| MD5 |
4d6a538431eb11201a92b9f16e991f9d
|
|
| BLAKE2b-256 |
eba4ad6daf8b719d16eca544e16f31cc89087258d89ee76b45523307909893c0
|
Provenance
The following attestation bundles were made for hoop_higher-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on Davi-Gurgel/hoop-higher
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hoop_higher-0.1.0-py3-none-any.whl -
Subject digest:
520e98ba9e7451e107cddd74b78671fd5302be76352dc7ed9250379eb500adcb - Sigstore transparency entry: 1342815033
- Sigstore integration time:
-
Permalink:
Davi-Gurgel/hoop-higher@fb84fd12be8881dddc3904e4f3987e2c2a1e9468 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Davi-Gurgel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@fb84fd12be8881dddc3904e4f3987e2c2a1e9468 -
Trigger Event:
push
-
Statement type: