A python pacakge for getting baseball stats
Project description
baseball-stats-python
A package that get baseball data from
Overview
Inspired by pybaseball. This pacakge is mainly focused on getting pitch-by-pitch data from Baseball Data Website like Baseball Savant and provide a easy way to get data for analytics.
Installation
Install the package via pip
pip install baseball-stats-python
Download the main branch by git clone
git clone https://github.com/ss77995ss/baseball-stats-python.git
pip with repository url
pip install git+https://github.com/ss77995ss/baseball-stats-python.git
Usage
statcast_search
Get pitch-by-pitch data from Baseball Savant with their search parameters. See documentation here.
from baseball_stats_python import statcast_search
# Get Dodgers's pitcher data in July 2024
statcast_search(
season="2024",
team='LAD',
player_type='pitcher',
month="7"
)
minor_statcast_search
Get pitch-by-pitch data from Baseball Savant's Minor League Statcast Search with their search parameters. See documentation here.
from baseball_stats_python import minor_statcast_search
# Get all pitch data in Triple-A in July 2024
minor_statcast_search(
season="2024",
level="AAA",
month="7"
)
mlbam_id_search
Search for MLBAM ID(s) by player name. Can be used to get player ID for statcast_batter_search and statcast_pitcher_search. See documentation here.
from baseball_stats_python import (
mlbam_id_search,
statcast_batter_search,
statcast_pitcher_search,
)
# Search for MLBAM ID(s) by player name
molina_mlbam_id = mlbam_id_search('Yadier Molina').iloc[0]['id']
# Get Yadier Molina's Statcast data
statcast_batter_search(batters_lookup=mlbam_id)
darvish_mlbam_id = mlbam_id_search('Yu Darvish').iloc[0]['id']
# Get Yu Darvish's Statcast data
statcast_pitcher_search(pitchers_lookup=darvish_mlbam_id)
Contributing
Welcome to open issues or pull requests to contribute to this project. Please read CONTRIBUTING.md for more details.
License
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
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 baseball_stats_python-0.2.3.tar.gz.
File metadata
- Download URL: baseball_stats_python-0.2.3.tar.gz
- Upload date:
- Size: 15.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4010da219e54688bb0cf0e97203eba0baba92ea5a66c95f549246558069bbe34
|
|
| MD5 |
cb61fe169c76b274a6f417a7c64dc423
|
|
| BLAKE2b-256 |
8c6f076177be7f5d3f2cb65e6ec545b6f9c5d17a611795d737ad6129e246763a
|
Provenance
The following attestation bundles were made for baseball_stats_python-0.2.3.tar.gz:
Publisher:
publish.yml on ss77995ss/baseball-stats-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
baseball_stats_python-0.2.3.tar.gz -
Subject digest:
4010da219e54688bb0cf0e97203eba0baba92ea5a66c95f549246558069bbe34 - Sigstore transparency entry: 173647081
- Sigstore integration time:
-
Permalink:
ss77995ss/baseball-stats-python@b9d6ac96b034286593031cee833b71cb31c9bc6b -
Branch / Tag:
refs/tags/v0.2.3 - Owner: https://github.com/ss77995ss
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b9d6ac96b034286593031cee833b71cb31c9bc6b -
Trigger Event:
push
-
Statement type:
File details
Details for the file baseball_stats_python-0.2.3-py3-none-any.whl.
File metadata
- Download URL: baseball_stats_python-0.2.3-py3-none-any.whl
- Upload date:
- Size: 16.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f5938f9fb10c4c7171de94eacf8dcbd502658221739d18a926ca4af37a9bd5f
|
|
| MD5 |
ac906e7e2e48f47d799095341ed2025a
|
|
| BLAKE2b-256 |
72bacfe6164eeb34f12592587133fc322a8c95aa463185b8bd577ee2921737fa
|
Provenance
The following attestation bundles were made for baseball_stats_python-0.2.3-py3-none-any.whl:
Publisher:
publish.yml on ss77995ss/baseball-stats-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
baseball_stats_python-0.2.3-py3-none-any.whl -
Subject digest:
4f5938f9fb10c4c7171de94eacf8dcbd502658221739d18a926ca4af37a9bd5f - Sigstore transparency entry: 173647084
- Sigstore integration time:
-
Permalink:
ss77995ss/baseball-stats-python@b9d6ac96b034286593031cee833b71cb31c9bc6b -
Branch / Tag:
refs/tags/v0.2.3 - Owner: https://github.com/ss77995ss
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b9d6ac96b034286593031cee833b71cb31c9bc6b -
Trigger Event:
push
-
Statement type: