pybaseball
MLB-StatsAPI
Our great sponsors
pybaseball | MLB-StatsAPI | |
---|---|---|
33 | 28 | |
1,083 | 446 | |
- | - | |
5.0 | 6.3 | |
23 days ago | 3 months ago | |
Python | Python | |
MIT License | GNU General Public License v3.0 only |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
pybaseball
-
Baseball Savant API
pybaseball and MLB-StatsAPI are the go-to python wrappers for the official MLB API.
- Data sources for MLB ABs?
-
MLB Stats API Application time?
most folks without direct access to mlb's api scrape baseball savant's data api. packages like baseballr or pybaseball can help with this. remember, this is in the open on a trust model: no commercial use, and don't hammer the api.
-
Where to get started analyzing basic baseball metrics
And if you’re using Python, it’s pybaseball I believe. https://github.com/jldbc/pybaseball
-
Play-by-play data for current season (similar to Retrosheet)
I think pybaseball works for this.
MLB-StatsAPI
-
Baseball Savant API
pybaseball and MLB-StatsAPI are the go-to python wrappers for the official MLB API.
- Data sources for MLB ABs?
-
Play-by-play data for current season (similar to Retrosheet)
I use mlbstats api personally https://github.com/toddrob99/MLB-StatsAPI
-
[Meta, kinda] What kind of software do the different team subreddits use to run the bots that generate/update game day threads?
Interesting. That covers the Reddit side. There's also a Python wrapper for the MLB API.
-
Coding for live scoreboard in PHP or Python?
Most actively developed python library for this would be MLB-StatsAPI
-
mlbcal - download your favorite team's game schedule
To celebrate the end of the MLB lockout and keep an eye out for soon-to-be rescheduled double header games I created a module to download the schedule for a given team from the MLB Stats API. It's kind of a stripped down version of something like MLB-StatsAPI in that in only focuses on a single endpoint (schedule) and it has a command line interface. Besides being a helpful tool for me it was good practice on thinking through project structure and user interface as well as publishing to PyPI.
-
What's the current standard for getting mlb data into a database? I used to use Baseball On a Stick (which accessed the old gameday data) but that doesn't work now. I found "mlbdata" which accesses the mlb API but I can't figure out how to make it put stuff into a database. Is there a good option?
I'm not aware of any services that load it directly into a database for you. There is the MLB-StatsAPI python wrapper which makes the API calls a bit more straightforward. Using something like that to retrieve the data is probably one of the easiest ways to pull the data you want. You can then write it to a csv, database table, ect with a pretty simple script. There's tons of documentation online of how to do this. You could do this in Python or whatever language you prefer.
-
How often is API data updated?
I went ahead and wrote the code while I was thinking through it (commit). I am working on next_game now and will release v1.3 to pypi once I have it fixed.
-
Get lineup and probable starters before game with MLB-StatsAPI
Get lineups from the game endpoint.
Is it possible to get the teams' lineups and probably starters before a game using MLB-StatsAPI? Thanks so much!
What are some alternatives?
BaseballTheater
baseballr - A package written for R focused on baseball analysis. Currently in development.
mlbgame - A Python API to retrieve and read MLB GameDay data
boxball - Prebuilt Docker images with Retrosheet's complete baseball history data for many analytical frameworks. Includes Postgres, cstore_fdw, MySQL, SQLite, Clickhouse, Drill, Parquet, and CSV.
mangadex - A python wrapper for the mangadex API V5. Work in progress
sports.py - A simple Python package to gather live sports scores
MLB-Sharp - Unofficial .NET wrapper library for the MLB Stats API. [Moved to: https://github.com/markjamesm/Baseball-Sharp]
mara-pipelines - A lightweight opinionated ETL framework, halfway between plain scripts and Apache Airflow
zenpy - Python wrapper for the Zendesk API
strat-o-rama - Generating plausible Strat-O-Matic cards from MLB data
hvcc - The heavy hvcc compiler for Pure Data patches.
investopedia_simulator_api - A simple Python API for Investopedia's stock simulator games. This programmatically logs into Investopedia and can retrieve portfolio summary, get stock quotes & option chain lookups, execute trades - buy & sell shares, puts, calls, sell short, etc.