Skip to main content

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)

  1. Clone the repository:

    git clone https://github.com/conorpcleary/mlb-cli-py.git
    cd mlb-cli-py
    
  2. Create and activate a virtual environment:

    python3 -m venv venv
    source venv/bin/activate
    
  3. 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:

  1. Version Bump: Update the version in pyproject.toml.
  2. GitHub Release: Create and publish a new Release on GitHub with a version tag (e.g., v0.1.0).
  3. 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.

Metadata

Release files for mlb-cli-py 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mlb-cli-py 0.1.0
File Size Uploaded
mlb_cli_py-0.1.0.tar.gz 24.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mlb-cli-py 0.1.0
File Interpreter ABI Platform
mlb_cli_py-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 48.7 kB

Release files / mlb_cli_py-0.1.0.tar.gz

Download URL mlb_cli_py-0.1.0.tar.gz
Size 24.3 kB
Tags Source
SHA-256 checksum
How to use checksums
fd0358cd8ac47978bad99b765eb33804a3e1b53cf890ad3817467548f0996310
BLAKE2b-256 checksum
How to use checksums
db705da66f85ca068c93fbe230ff7c1a3b4d45dfb87cbce3c897e92eaaa491ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 17, 2026.

Transparency log

Release files / mlb_cli_py-0.1.0-py3-none-any.whl

Download URL mlb_cli_py-0.1.0-py3-none-any.whl
Size 24.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a6d098adeb9da5bbf82ff5686bdb62e00930e08cb61de4813f9c7bfc0ed76841
BLAKE2b-256 checksum
How to use checksums
e7fa5b945bf53aecd78b231cd6b8f11065b1d5dd4bdaecaf106b3e1385010d8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 17, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page