-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from xaph/32-fetch-all-players-in-league
32 fetch all players in league
- Loading branch information
Showing
4 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from yahoofantasy import Context | ||
|
||
c = Context() | ||
|
||
# Get all basketball leagues belonged to 2023 | ||
leagues = c.get_leagues("nba", 2023) | ||
# select the first league to get players from | ||
league = leagues[0] | ||
# Print the name of the league and whether it was private/public | ||
print(league.name + " -- " + league.league_type) | ||
|
||
# Iterate through standings and show every team's win/loss record | ||
for player in league.players(): | ||
print(f"{player.name.full} - {player.display_position} - {player.editorial_team_abbr}") | ||
|
||
print(f"{len(league.players())} players found in the league") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters