From 4cbe592e0a0fae13f0a89918a66fd983dd84464f Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Wed, 15 Apr 2026 22:28:45 -0500 Subject: feat: add Textual TUI with auto-refresh, leaders, playoff picture, and box score MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduces an interactive terminal UI via the `--tui` flag backed by the Textual framework. Scores and standings auto-refresh on a configurable interval (default 60s, minimum 10s) using asyncio with nba_api calls offloaded to a thread pool to keep the event loop unblocked. New tabs: - Scores / Standings (existing views, now live-updating) - Leaders: top-25 by stat category, cycle with < / > keys - Playoff Picture: conference seeding with clinch/elimination status - Box Score: per-player live stats, load any game with keys 1–9 Refactored scores.py and standings.py to separate rendering from I/O (get_scoreboard_table, get_east/west_standings_table), keeping the existing static CLI path fully intact. Added -sc / -st shortcut flags. Adds textual>=0.89.1,<7.0 dependency, build-system declaration for uv, and package-data entry for the bundled .tcss stylesheet. --- pyproject.toml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'pyproject.toml') diff --git a/pyproject.toml b/pyproject.toml index 925317f..2133f02 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ authors = [ ] description = "A CLI interface to get current NBA scores and standings." readme = "README.md" -requires-python = ">=3.8" +requires-python = ">=3.9" license = "GPL-3.0-or-later" classifiers = [ "Programming Language :: Python :: 3", @@ -15,7 +15,8 @@ classifiers = [ dependencies = [ "nba_api", "tabulate", - "argparse" + "argparse", + "textual>=0.89.1,<7.0" ] [project.urls] @@ -25,6 +26,16 @@ Issues = "https://git.cleberg.net/nba-scores.git" [project.scripts] nba = "nba.cli:nba" +[build-system] +requires = ["setuptools>=68"] +build-backend = "setuptools.build_meta" + +[tool.uv] +package = true + [tool.setuptools.packages.find] where = ["."] -include = ["nba"] +include = ["nba*"] + +[tool.setuptools.package-data] +"nba.tui" = ["*.tcss"] -- cgit v1.2.3