boxball
baseball_sql
Our great sponsors
boxball | baseball_sql | |
---|---|---|
7 | 4 | |
110 | 2 | |
- | - | |
5.5 | 5.7 | |
4 months ago | 3 months ago | |
Python | Jupyter Notebook | |
Apache License 2.0 | - |
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.
boxball
-
Importing Retrosheet to Tableau or Power BI
I haven't worked with BI tools, but I'll make the same recommendation for Retrosheet data that I always do: check out the Boxball distributions, specifically the CSV files (or the parquet files if you prefer). You can load those right in, rather than futzing with Retrosheet's event files and processing them manually, etc., just to get to the same spot.
-
Delta Aging Curve Python
The original data source is the Baseball Databank (aka "The Lahman Database"). I use the Boxball distributions, which include both retrosheet and Baseball Databank data.
- 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?
-
How do I compile a list of a team's games where event x did not happen?
You know, I thought about that after posting, that the dailies might not be available directly from retrosheet. I use the Boxball distributions, which take the retrosheet data and process it into database images. These distributions include a "daily" table with the daily logs. So apparently Boxball is generating that table.
-
Aggregate Game Logs
I used to think the same thing, and then I found the Boxball pre-built images. You still have to be a bit handy to get them working, but it's way easier than starting from scratch with raw retrosheet data. I initially used the postgres image and worked in SQL, and then switched to python/pandas and the parquet files.
-
Finding a player's stats through N games
I've always been good with data, math, Excel, etc., but decided to take it to another level during the pandemic. The most difficult thing about Retrosheet data is getting into a usable format. Luckily, the boxball project has created a number of ready-to-download images with all of the data, for different database technologies.
-
RE24 Data for wOBA Calculations
For Retrosheet data, I've been using pre-built images from Boxball, rather than going through the whole process of downloading and converting the files from retrosheet. The Boxball images are awesome. I mostly use the Parquet files for Pandas, but they have other formats (e.g., postgres Docker images, CSV, etc) there.
baseball_sql
-
Looking for feedback on my implementation of the Marcel Projections in Python
You'll pick up on this stuff as you read and write more code, and your code will become simpler. Inspired by your work, I took my own pass at implementing Marcels today. Feel free to take a look and ask me any questions.
-
[Brenden] Feel free to correct me if I'm wrong, but I think it's safe to say this is the first time in MLB history that the winning pitcher of game 1 in a doubleheader is the starting catcher of game 2.
If you do check it out, and use python/pandas, here is some code I wrote to make the Retrosheet game log data more usable (cells 1-6 specifically). It corrects some inconsistencies in column names, and adds useful columns like year, game_id, game type.
-
In honor of Tony’s birthday here are a few crazy Tony Gwynn stats
If anybody is curious, my code and details are here.
-
Finding a player's stats through N games
I started with SQL and then moved to python/pandas. And basically it just took a lot of practice; any time I hear a fun fact or trivia question, I see if I can replicate it myself. Even if I know something is easy to do with Stathead, I've forced myself to code it myself. I moved on to harder and more interesting stuff, like component park factors, aging curves, umpire effects, etc. Some of my code is here.
What are some alternatives?
pybaseball - Pull current and historical baseball statistics using Python (Statcast, Baseball Reference, FanGraphs)
Marcels - Implemented the 2022 Marcel Projections in Python
ElectroCRUD - Database CRUD Application Built on Electron | MySQL, Postgres, SQLite
chadwick - Chadwick tools for manipulating baseball data
baseballr - A package written for R focused on baseball analysis. Currently in development.
condenser - Condenser is a database subsetting tool
MLB-StatsAPI - Python wrapper for MLB Stats API
mlbgame - A Python API to retrieve and read MLB GameDay data
sqlx - 🧰 The Rust SQL Toolkit. An async, pure Rust SQL crate featuring compile-time checked queries without a DSL. Supports PostgreSQL, MySQL, and SQLite.
goqu - SQL builder and query library for golang
beisbol-analitica - Proyecto de Código Libre que tiene como objetivo facilitar herramientas e información a los analistas y equipos de Beisbol Latinoamericanos.
sports.py - A simple Python package to gather live sports scores