Skip to content

Commit 58bc94d

Browse files
authored
v0.0.6 - added docs, lookup_team() and lookup_player()
2 parents 9c38fc2 + e37613d commit 58bc94d

File tree

5 files changed

+4811
-22
lines changed

5 files changed

+4811
-22
lines changed

README.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,40 +15,41 @@ If you install manually, be sure to also install requests.
1515

1616
## Available Functions
1717

18-
* `statsapi.get()` - make calls directly to MLB StatsAPI endpoints;
19-
supports the most flexibility in request parameters, and returns raw json data
18+
* `statsapi.get()` - make calls directly to MLB StatsAPI endpoints; supports the most flexibility in request parameters, and returns raw json data
2019

21-
* `statsapi.meta()` - retrieve available values from StatsAPI for use in other queries,
22-
or look up descriptions for values found in API results
20+
* `statsapi.meta()` - retrieve available values from StatsAPI for use in other queries, or look up descriptions for values found in API results
2321

24-
* `statsapi.notes()` - retrieve notes for a given endpoint,
25-
including a list of required parameters, as well as hints for some endpoints
22+
* `statsapi.notes()` - retrieve notes for a given endpoint, including a list of required parameters, as well as hints for some endpoints
23+
24+
* `statsapi.lookup_player()` - get a list of player data based on first, last, or full name, jersey number, current team Id, position, etc.
25+
26+
* `statsapi.lookup_team()` - get a lsit of teams info based on the team name, city, abbreviation, or file code
2627

2728
* `statsapi.schedule()` - retrieve a list of games on a given date/range and/or team/opponent
2829

2930
* `statsapi.boxscore()` - generate a formatted boxscore for a given game
3031

3132
* `statsapi.linescore()` - generate a formatted linescore for a given game
3233

33-
* `statsapi.roster()` - generate a list of players on a team's roster
34+
* `statsapi.roster()` - generate a formatted list of players on a team's roster
3435

3536
* `statsapi.standings()` - generate a formatted list of standings for a given league/date
3637

37-
* `statsapi.team_leaders()` - generate a list of a team's leaders for a given stat
38+
* `statsapi.team_leaders()` - generate a formatted list of a team's leaders for a given stat
3839

39-
* `statsapi.league_leaders()` - generate a list of stat leaders for all-time (single season) or a given season
40+
* `statsapi.league_leaders()` - generate a formatted list of stat leaders for all-time (single season) or a given season
4041

41-
* `statsapi.player_stats()` - get a list of a player's career or season stats
42+
* `statsapi.player_stats()` - generate a formatted list of a player's career or season stats
4243

4344
* `statsapi.last_game()` - get the game id for the given team's most recent game
4445

4546
* `statsapi.next_game()` - get the game id for the given team's next game
4647

47-
* `statsapi.game_highlights()` - generate a list of highlights with video links for a given game
48+
* `statsapi.game_highlights()` - generate a formatted list of highlights with video links for a given game
4849

49-
* `statsapi.game_pace()` - get information about pace of game for a given season (back to 1999)
50+
* `statsapi.game_pace()` - generate a formatted list of pace of game information for a given season (back to 1999)
5051

51-
* `statsapi.game_scoring_plays()` - get a list of scoring plays for a given game
52+
* `statsapi.game_scoring_plays()` - generate a formatted list of scoring plays for a given game
5253

5354
## Example Use
5455

@@ -133,7 +134,9 @@ use `statsapi.get()` to call the sports_players endpoint for the 2008 World Seri
133134
lookup Chase Utley's person id from the results, and pass it into `statsapi.player_stats()`
134135
using `type='hitting'` and `group='career'`
135136

137+
```
136138
print( statsapi.player_stats(next(x['id'] for x in statsapi.get('sports_players',{'season':2008,'gameType':'W'})['people'] if x['fullName']=='Chase Utley'), 'hitting', 'career') )
139+
```
137140

138141
### Print a list of scoring plays from the 4/28/2019 Marlins @ Phillies game
139142

0 commit comments

Comments
 (0)