Skip to main content

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

MIT 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

baseball_stats_python-0.2.4.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

baseball_stats_python-0.2.4-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

Details for the file baseball_stats_python-0.2.4.tar.gz.

File metadata

  • Download URL: baseball_stats_python-0.2.4.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for baseball_stats_python-0.2.4.tar.gz
Algorithm Hash digest
SHA256 7c2821f3f0fe1e2fa00081abb053257bf72cc1afdcc686902f6cf76209c2656c
MD5 cd0ef80fa547de7aa897499d10a046e0
BLAKE2b-256 24361be6c512957b88e077fbf622f2956be6e6a9e00b099009909a2d7798b73f

See more details on using hashes here.

Provenance

The following attestation bundles were made for baseball_stats_python-0.2.4.tar.gz:

Publisher: publish.yml on ss77995ss/baseball-stats-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file baseball_stats_python-0.2.4-py3-none-any.whl.

File metadata

File hashes

Hashes for baseball_stats_python-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ca0085355796919f5f95609bad0ce5d03fde4859758b0f6e7e2050db8b88ccd8
MD5 60e4095f8ec387b505de2ed08058f7cc
BLAKE2b-256 01dc846181d275ebe5ab3db781dc4047d1de679c44e5e291c4c28a0c3ad907d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for baseball_stats_python-0.2.4-py3-none-any.whl:

Publisher: publish.yml on ss77995ss/baseball-stats-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page