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.3.tar.gz (15.5 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.3-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

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

Hashes for baseball_stats_python-0.2.3.tar.gz
Algorithm Hash digest
SHA256 4010da219e54688bb0cf0e97203eba0baba92ea5a66c95f549246558069bbe34
MD5 cb61fe169c76b274a6f417a7c64dc423
BLAKE2b-256 8c6f076177be7f5d3f2cb65e6ec545b6f9c5d17a611795d737ad6129e246763a

See more details on using hashes here.

Provenance

The following attestation bundles were made for baseball_stats_python-0.2.3.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.3-py3-none-any.whl.

File metadata

File hashes

Hashes for baseball_stats_python-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4f5938f9fb10c4c7171de94eacf8dcbd502658221739d18a926ca4af37a9bd5f
MD5 ac906e7e2e48f47d799095341ed2025a
BLAKE2b-256 72bacfe6164eeb34f12592587133fc322a8c95aa463185b8bd577ee2921737fa

See more details on using hashes here.

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

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