A modern TUI for MLB scores, standings, and schedules
Project description
MLB Box Score TUI
A Python-based Terminal User Interface (TUI) for Major League Baseball (MLB) scores, schedules, and standings. Built with pytermgui and the MLB-StatsAPI, featuring a modular architecture and 100% test coverage.
Features
- Full Season Schedule: Navigate the entire 2026 MLB season through a dedicated calendar view or daily snapshots.
- Dynamic Standings: Real-time standings for all 6 MLB divisions (AL and NL), including comprehensive Wild Card rankings.
- Interactive Calendar: A multi-month calendar view for quick date selection, featuring intuitive WASD keyboard navigation and automatic focus management.
- Smart Caching: Built-in caching service to minimize API calls and ensure a responsive user experience.
- Smooth Transitions: Animated screen transitions for a modern, fluid feel.
- Robust Architecture: Surgical, class-based organization of widgets and screens for high maintainability.
Installation
From PyPI (Recommended)
Install the application directly using pip:
pip install mlb-cli-py
Local Setup (Development)
-
Clone the repository:
git clone https://github.com/conorpcleary/mlb-cli-py.git cd mlb-cli-py
-
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate
-
Install in editable mode:
pip install -e ".[dev]"
Usage
After installation, run the application from anywhere in your terminal:
mlb-cli
Controls
The application is designed for rapid keyboard-driven navigation.
Global Controls
| Key | Action |
|---|---|
[ |
Previous Day / Previous Calendar Page (with wrapping) |
] |
Next Day / Next Calendar Page (with wrapping) |
t |
Jump to Today's Schedule |
c |
Switch to Calendar View |
x |
Toggle Standings View |
ESC |
Exit the application |
Tab |
Cycle focus between UI components |
Calendar Navigation
When in the Calendar view, you can use specialized keys for precise date selection:
| Key | Action |
|---|---|
W |
Move focus up one week |
A |
Move focus left one day |
S |
Move focus down one week |
D |
Move focus right one day |
Enter |
Select the focused date and view its schedule |
Project Structure
The project follows a strict modular design optimized for distribution:
mlb-cli-py/
├── pyproject.toml # Modern build system configuration and metadata
├── app/
│ ├── mlb_cli.py # Main application controller and TUI entry point
│ ├── models/ # Data services (API fetching, caching, date utilities)
│ ├── widgets/ # Modular TUI components (Game, Standing, Calendar widgets)
│ └── screens/ # Class-based screen definitions (Schedule, Standings, Calendar)
├── tests/ # 100% covered test suite (Unit and integration tests)
└── README.md # You are here!
Development & Testing
The project maintains a perfect 10.00/10 Pylint score and 100% test coverage.
Running Tests
To run the full test suite using pytest:
PYTHONPATH=. pytest
Linting
To verify code quality:
pylint app tests
Release Workflow
This project uses an automated release pipeline to publish updates to PyPI:
- Version Bump: Update the version in
pyproject.toml. - GitHub Release: Create and publish a new Release on GitHub with a version tag (e.g.,
v0.1.0). - Automated Publish: A GitHub Action is triggered by the release, which:
- Builds the source distribution and wheel.
- Publishes the package to PyPI using Trusted Publishing (OIDC).
Acknowledgements
This project would not be possible without the MLB-StatsAPI and PyTermGUI projects.
License
MIT License - see LICENSE for details.
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 mlb_cli_py-0.1.0.tar.gz.
File metadata
- Download URL: mlb_cli_py-0.1.0.tar.gz
- Upload date:
- Size: 24.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd0358cd8ac47978bad99b765eb33804a3e1b53cf890ad3817467548f0996310
|
|
| MD5 |
85ef5ffd54a22ea075c0dc59100b80af
|
|
| BLAKE2b-256 |
db705da66f85ca068c93fbe230ff7c1a3b4d45dfb87cbce3c897e92eaaa491ef
|
Provenance
The following attestation bundles were made for mlb_cli_py-0.1.0.tar.gz:
Publisher:
publish.yml on conorpcleary/mlb-cli-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mlb_cli_py-0.1.0.tar.gz -
Subject digest:
fd0358cd8ac47978bad99b765eb33804a3e1b53cf890ad3817467548f0996310 - Sigstore transparency entry: 1563002366
- Sigstore integration time:
-
Permalink:
conorpcleary/mlb-cli-py@fba23aff7e4ba6f8d72a573941102010559166f1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/conorpcleary
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@fba23aff7e4ba6f8d72a573941102010559166f1 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mlb_cli_py-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mlb_cli_py-0.1.0-py3-none-any.whl
- Upload date:
- Size: 24.4 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 |
a6d098adeb9da5bbf82ff5686bdb62e00930e08cb61de4813f9c7bfc0ed76841
|
|
| MD5 |
c5110b6fd34266fec4e1c243ba1b3344
|
|
| BLAKE2b-256 |
e7fa5b945bf53aecd78b231cd6b8f11065b1d5dd4bdaecaf106b3e1385010d8d
|
Provenance
The following attestation bundles were made for mlb_cli_py-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on conorpcleary/mlb-cli-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mlb_cli_py-0.1.0-py3-none-any.whl -
Subject digest:
a6d098adeb9da5bbf82ff5686bdb62e00930e08cb61de4813f9c7bfc0ed76841 - Sigstore transparency entry: 1563002411
- Sigstore integration time:
-
Permalink:
conorpcleary/mlb-cli-py@fba23aff7e4ba6f8d72a573941102010559166f1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/conorpcleary
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@fba23aff7e4ba6f8d72a573941102010559166f1 -
Trigger Event:
release
-
Statement type: