Skip to main content

A library to query MLB stats including on a game level

Project description

Baseball Query

It's a stathead replacement, plain and simple.

When you install this package and import it for the first time, it will download many GB of data from retrosheet. Eventually, it will be deleted, but you will get a total of 12 GB of data in the form of an hdf5 file. This is a lot of data, but it's necessary. This whole process (including calculating linear weights) can take upwards of an hour so start running this in the background once you install it before you use it.

Not implemented (as of when I finish this):

  • Park factors
  • Full game stats (saves, holds, shutouts, etc.) for pitchers. This one is probably important
  • GB%, LD%, FB%, and PU% will deviate from fangraphs due to differences in data and it being quite subjective. Also, Fangraphs FB is more similar to FB+PU so that's what I used in HR/FB% calculations.
    • This probably is impossible to fix

Recipients of Retrosheet data are free to make any desired use of the information, including (but not limited to) selling it, giving it away, or producing a commercial product based upon the data. Retrosheet has one requirement for any such transfer of data or product development, which is that the following statement must appear prominently:

 The information used here was obtained free of
 charge from and is copyrighted by Retrosheet.  Interested
 parties may contact Retrosheet at "www.retrosheet.org".

Retrosheet makes no guarantees of accuracy for the information that is supplied. Much effort is expended to make our website as correct as possible, but Retrosheet shall not be held responsible for any consequences arising from the use of the material presented here. All information is subject to corrections as additional data are received. We are grateful to anyone who discovers discrepancies and we appreciate learning of the details.

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

baseballquery-0.0.1.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

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

baseballquery-0.0.1-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file baseballquery-0.0.1.tar.gz.

File metadata

  • Download URL: baseballquery-0.0.1.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for baseballquery-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c24653e44bb2324f0712da19fb5cf1548cc6b05fc5c58e9aa58424aea26d51f4
MD5 13c3b876fa01e119b901650b280e28f1
BLAKE2b-256 e41f3095349ab4aba48332cd2745579130c9b3c599a50b067935fb62a5de6370

See more details on using hashes here.

File details

Details for the file baseballquery-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: baseballquery-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for baseballquery-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a6fa9dd1e85761ea6fabe7be55146778a1d16e8c793943a7cb09a6328b5ab1cf
MD5 4406056bf51e3bbd31815bd30aa53e0b
BLAKE2b-256 456ddecf07f15f4b8f0c09c3b9031c97e87d81ad506ab1f21ce5558a74804ae6

See more details on using hashes here.

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