Baseball Savant leaderboard data with date range support — complements pybaseball
Project description
savant-extras
Baseball Savant leaderboard data with date range support.
pybaseball is great for season-level data, but all its leaderboard functions are limited to full seasons. savant-extras fills that gap by supporting arbitrary date ranges — enabling monthly splits, first/second half comparisons, pre/post trade analysis, and more.
Bat tracking data (Hawk-Eye) is available from the 2024 season onward.
Installation
pip install savant-extras
Quick Start
from savant_extras import bat_tracking, bat_tracking_monthly, bat_tracking_splits
# April 2024 — batter bat tracking
df = bat_tracking("2024-04-01", "2024-04-30")
# Pitcher perspective
df = bat_tracking("2024-04-01", "2024-06-30", player_type="pitcher")
# Full season broken down by month
df = bat_tracking_monthly(2024)
print(df.groupby("month")["avg_bat_speed"].mean())
# First half vs second half
splits = bat_tracking_splits(2024)
first = splits["first_half"]
second = splits["second_half"]
Functions
bat_tracking(start_date, end_date, player_type="batter", min_swings="q")
Retrieve bat tracking leaderboard for any date range.
| Parameter | Type | Default | Description |
|---|---|---|---|
start_date |
str | — | Start date YYYY-MM-DD |
end_date |
str | — | End date YYYY-MM-DD |
player_type |
str | "batter" |
"batter" or "pitcher" |
min_swings |
int or str | "q" |
Minimum competitive swings ("q" = qualified) |
Returns: pd.DataFrame with columns including avg_bat_speed, swing_tilt, attack_angle, etc.
bat_tracking_monthly(year, player_type="batter", min_swings=1)
Retrieve bat tracking for each month of a season (April–October).
Adds a month column to the returned DataFrame.
bat_tracking_splits(year, player_type="batter", min_swings="q")
Retrieve first-half / second-half splits. Returns a dict:
{"first_half": pd.DataFrame, "second_half": pd.DataFrame}
Why savant-extras?
| pybaseball | savant-extras | |
|---|---|---|
| Full season data | ✅ | ✅ |
| Monthly splits | ❌ | ✅ |
| First/second half | ❌ | ✅ |
| Custom date range | ❌ | ✅ |
| Pre/post trade splits | ❌ | ✅ |
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file savant_extras-0.1.0.tar.gz.
File metadata
- Download URL: savant_extras-0.1.0.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28440987208ef780b6745b826b2b36eb87be7fe47fb01b48ae2506836bfa5d13
|
|
| MD5 |
cbedddb7def30c4aa8409a232e00463d
|
|
| BLAKE2b-256 |
5afe2d0b715c9645664c3a0a6ca78be6c81cf643f551ee8268437aa21ec108be
|
File details
Details for the file savant_extras-0.1.0-py3-none-any.whl.
File metadata
- Download URL: savant_extras-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
656a2ecbbd6fc6b53a13bb55a1198723e93c5c4c3621fbb557b696250e393959
|
|
| MD5 |
a4ae4758a21e3748438d92d249e3e5be
|
|
| BLAKE2b-256 |
7f9347b8282c994c960062778e8dbf5935405840cad35f92b07c5e5bd2e1fdc1
|