Skip to main content

baseball_id

Do you analyze baseball data from several sources and need to find a way to correlate it for the same player? This takes advantage of the data published at https://github.com/spilchen/baseball_id_db. With the data you can take a player from Yahoo! and cross reference with data from sites such as http://baseball-reference.com, http://fangraphs.com, http://www.seanlahman.com. This package gives you a way to access this map within Python. A set of APIs allow you to do lookup of players by a variety of different IDs.

Build status

https://travis-ci.com/spilchen/baseball_id.svg?branch=master Documentation Status

Installation

This package can be installed via pip:

pip install baseball_id

or from the repo:

git clone https://github.com/spilchen/baseball_id
cd baseball_id
python setup.py install

Documentation

The documentation are hosted at readthedocs.io: https://baseball-id.readthedocs.io/en/latest/

Sample API Usage

In [1]: from baseball_id import Lookup

In [2]: Lookup.from_mlb_ids([430945, 607680, 669456])
Out[2]:
      mlb_id      mlb_name mlb_pos ...  ottoneu_name ottoneu_pos  rotowire_id  rotowire_name rotowire_pos
39    430945    Adam Jones      CF ...    Adam Jones          OF       8165.0     Adam Jones           OF
1746  607680  Kevin Pillar      CF ...  Kevin Pillar          OF      12678.0   Kevin Pillar           OF
2545  669456  Shane Bieber       P ...  Shane Bieber          SP      14383.0   Shane Bieber            P

[3 rows x 35 columns]

In [3]: Lookup.from_yahoo_ids([10794, 9542, 7578])
Out[3]:
      mlb_id        mlb_name mlb_pos ... ottoneu_pos rotowire_id   rotowire_name  rotowire_pos
5     621345     A.J. Minter       P ...          RP     13889.0     A.J. Minter             P
204   605151  Archie Bradley       P ...          RP     12131.0  Archie Bradley             P
2340  448179       Rich Hill       P ...          SP      7965.0       Rich Hill             P

[3 rows x 35 columns]

In [4]: Lookup.from_cbs_ids([1660162, 2507367])
Out[4]:
      mlb_id      mlb_name mlb_pos ...  ottoneu_name ottoneu_pos  rotowire_id  rotowire_name rotowire_pos
423   457763  Buster Posey       C ...  Buster Posey        C/1B      10426.0   Buster Posey            C
1657  665742     Juan Soto      LF ...     Juan Soto          OF      13960.0      Juan Soto           OF

[2 rows x 35 columns]

In [5]: Lookup.from_espn_ids([29252])
Out[5]:
     mlb_id       mlb_name mlb_pos ...   ottoneu_name ottoneu_pos  rotowire_id  rotowire_name rotowire_pos
836  451594  Dexter Fowler      RF ...  Dexter Fowler          OF       8271.0  Dexter Fowler           OF

[1 rows x 35 columns]

In [6]: Lookup.from_fangraphs_ids([19753, 19566])
Out[6]:
      mlb_id           mlb_name mlb_pos ... ottoneu_pos rotowire_id      rotowire_name  rotowire_pos
1510  642528  Jonathan Loaisiga       P ...       SP/RP     15256.0  Jonathan Loaisiga             P
2133  663993          Nate Lowe      1B ...          1B         NaN                NaN           NaN

[2 rows x 35 columns]

Metadata

Release files for baseball-id 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for baseball-id 0.1.0
File Size Uploaded Provenance Actions
baseball_id-0.1.0.tar.gz 216.9 kB Without provenance Details for baseball_id-0.1.0.tar.gz

Release files / baseball_id-0.1.0.tar.gz

Download URL baseball_id-0.1.0.tar.gz
Size 216.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4cfe5b0d367e8a22f3e58da43949a5161fa134e2c1f2705a3a193fd437489971
BLAKE2b-256 checksum
How to use checksums
5223d876b120c5ffbb281618c2d0b2e05022669d2de18af831943da9d2318bc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

Security for baseball-id 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page