jldbc / pybaseball

Pull current and historical baseball statistics using Python (Statcast, Baseball Reference, FanGraphs)
MIT License
1.25k stars 333 forks source link

Issue 284 top prospects #289

Closed KyleDirks closed 1 year ago

KyleDirks commented 1 year ago

I looked up each team's id currently being used on the mlb site and saved as csv to the data folder. Then, I updated teamid_lookup.py with a function to pull these team IDs and referenced that in top_prospects.py to fix the bug

KyleDirks commented 1 year ago

Example of using mlb_com_team_id():

from pybaseball import teamid_lookup
id = teamid_lookup.mlb_com_team_id(teamName = "bluejays")
print(id)

Use of top_prospects is unchanged. Example:

from pybaseball import top_prospects
tp = top_prospects("mariners", "pitchers")
tp.head(2)

image

tjburch commented 1 year ago

Thanks for the contribution @KyleDirks. This already looks pretty good, I'll give it review as soon as I can.

tjburch commented 1 year ago

@KyleDirks any updates here?

tjburch commented 1 year ago

Closing, covered by #307