Skip to content

ahump20/baseball

v1.0.1MIT

Baseball fundamentals: rules and scoring, wOBA, wRC+, FIP and sample-size reliability computed by a tested script with FanGraphs constants, MLB and college run environments, and free data sources.

baseball

/plugin marketplace add ahump20/Sports-Plugins
/plugin install baseball@Sports-Plugins
SkillWhat it does
baseball-rulesRulings, scoring decisions and how MLB, NCAA and high school rules differ, with rule numbers from the 2026 MLB and current NCAA rulebooks
baseball-analyticssaber.py computes slash line, wOBA, wRC+, FIP and rates from counting stats, pulls MLB lines from the Stats API, and builds league constants for college from totals
baseball-dataVerified MLB Stats API, Baseball Savant and Lahman URLs, JSON paths and traps

Checked against published numbers in skills/baseball-analytics/tests:

CaseExpectedSource
Shohei Ohtani 2024 wOBA.431FanGraphs, Baseball Savant
Tarik Skubal 2024 FIP2.49FanGraphs
MLB 2024 wOBA scale from league totals1.242FanGraphs Guts
python3 -m unittest discover -s plugins/baseball/skills/baseball-analytics/tests
SPORTS_LIVE=1 python3 -m unittest discover -s plugins/baseball/skills/baseball-analytics/tests   # also hits the MLB Stats API

Python 3.9+, standard library only.