Skip to main content

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)

  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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mlb_cli_py-0.1.0.tar.gz (24.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mlb_cli_py-0.1.0-py3-none-any.whl (24.4 kB view details)

Uploaded Python 3

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

Hashes for mlb_cli_py-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fd0358cd8ac47978bad99b765eb33804a3e1b53cf890ad3817467548f0996310
MD5 85ef5ffd54a22ea075c0dc59100b80af
BLAKE2b-256 db705da66f85ca068c93fbe230ff7c1a3b4d45dfb87cbce3c897e92eaaa491ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for mlb_cli_py-0.1.0.tar.gz:

Publisher: publish.yml on conorpcleary/mlb-cli-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for mlb_cli_py-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a6d098adeb9da5bbf82ff5686bdb62e00930e08cb61de4813f9c7bfc0ed76841
MD5 c5110b6fd34266fec4e1c243ba1b3344
BLAKE2b-256 e7fa5b945bf53aecd78b231cd6b8f11065b1d5dd4bdaecaf106b3e1385010d8d

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page