Skip to main content

Follow any MLB game in your shell

Project description

scorebug: live MLB play-by-play for your shell

Follow MLB games in your terminal. Fast to start, easy to read, scriptable.

Install

  • From PyPI

    pip install scorebug
    
  • Local checkout (editable)

    • Clone this repo
    • pip install -e .

Requires Python 3.9+.

Usage

  • Positional team or prompt
scorebug dodgers
# or just run `scorebug` and enter a team when prompted
  • Specific game by gamePk
scorebug --gamepk 716910
  • Show every pitch and start from the first at-bat
scorebug yankees --pitches --from-start

What it does

  • Finds today's game for a team (or uses --gamepk)
  • Streams new at-bats and optionally every pitch
  • Prints a compact scoreboard on change or inning transitions
  • Highlights scoring plays
  • If no game is live, prints the last final and the next scheduled game

Output behavior

  • Uses team abbreviations in the scoreboard
  • Shows ▲ for top and ▼ for bottom of the inning
  • Reprints a play if its description updates
  • Prints the scoreboard at start of halves and on End/Middle of innings
  • Prints an inning banner on half-inning transitions for readability
  • Colors: cyan for away, magenta for home, green for scoring plays
  • Disable color with --no-color
  • Includes ball-strike count and approximate pitch count per at-bat
  • Shows base runners when available (◉ occupied, ○ empty)
  • Pre-game shows probable pitchers and local start time
  • If a team has multiple games today, you can select which one to follow

CLI reference

  • team: team id, abbr, or name (e.g., 119, LAD, Dodgers)
  • --team: same as positional team
  • --date YYYY-MM-DD: date to search (default: today in Los Angeles)
  • --gamepk: MLB gamePk to stream directly
  • --interval: poll seconds (default 2.5)
  • --pitches: print each pitch
  • --from-start: print all prior at-bats on first fetch
  • --no-color: disable ANSI color
  • --scoring-only: only print scoring plays and inning transitions
  • --opponent TEAM: disambiguate doubleheaders by opponent (id, abbr, or name)
  • --log FILE: append the live stream to a file
  • --dump FILE: write full game log for the selected game and exit
  • --tz ZONE: override local timezone (e.g., America/New_York)
  • --line-score: print inning-by-inning linescore under the scoreboard
  • --box-interval N: every N minutes, reprint the scoreboard even if unchanged
  • --quiet: only scoreboard and inning banners
  • --verbose: extra details (pitches and runners)

Notes

  • Data comes from MLB StatsAPI schedule and the v1.1 live feed
  • Uses If-None-Match to avoid reprinting unchanged states
  • Team IDs are cached in ~/.scorebug/teams-<season>.json to reduce API calls

Config (optional)

Create ~/.scorebug/config.toml to set defaults:

team = "Dodgers"          # default team
tz = "America/Los_Angeles" # IANA timezone
interval = 2.5             # poll seconds
no_color = false           # disable ANSI color
line_score = true          # show inning-by-inning line score
box_interval = 5           # minutes between forced scoreboard prints

Roadmap

  • ASCII line score per inning (lightweight)
  • RISP highlighting and men-on-base summary lines
  • Opponent filter improvements when multiple games in a day
  • Config file for defaults and cached team map
  • Better historical dump by team/date range

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

scorebug-0.2.0.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

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

scorebug-0.2.0-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file scorebug-0.2.0.tar.gz.

File metadata

  • Download URL: scorebug-0.2.0.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for scorebug-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5584316f19be90e1ccfb566973f14c6431bf4b40cecbdc8e226d0ba13a44ddaa
MD5 d2f3126dca71b5d62d6d40db3162b559
BLAKE2b-256 92717726244b646fa131e916c4f45572b2257fb53c9a01c36315b5dfd79d930b

See more details on using hashes here.

File details

Details for the file scorebug-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: scorebug-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for scorebug-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 34380514d315fa13adb01fb010ad8f90e6786120296d81e0404f333642e6e2ab
MD5 5851de8a1551df5cc36c9c9a0495c138
BLAKE2b-256 1715544f9f064d3971b4af81d2453c9185772bc3bf4f0c844c3aeaf5dab7d03a

See more details on using hashes here.

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