toddrob99 / MLB-StatsAPI

Python wrapper for MLB Stats API
GNU General Public License v3.0
534 stars 100 forks source link

Printing only League Standings for specific Division #34

Closed ssienrukos closed 4 years ago

ssienrukos commented 4 years ago

I am trying to grab the league standings for the National League East only and I can not figure out the value for division to put in print(statsapi.standings(leagueId=104, date='05/12/2019'))

Thank you in advance! Go Phils!!

toddrob99 commented 4 years ago

Include the division parameter with the value being the division abbreviation, in this case nle:

>>> print(statsapi.standings(leagueId=104, division='nle', date='05/12/2019'))
National League East
Rank Team                   W   L   GB  (E#) WC Rank WC GB (E#)
 1   Philadelphia Phillies 23  16   -    -      -      -    -
 2   Atlanta Braves        21  20  3.0  120     6     1.0  121
 3   New York Mets         19  20  4.0  120     7     2.0  121
 4   Washington Nationals  16  24  7.5  116    11     5.5  117
 5   Miami Marlins         10  29  13.0 111    12    11.0  112
ssienrukos commented 4 years ago

Thank you so much! My husband and I are kicking ourselves in the butt because it is so obvious lol