-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c9cba63
commit e02bc77
Showing
4 changed files
with
27 additions
and
25 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
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 |
---|---|---|
@@ -1,17 +1,11 @@ | ||
from sleeper.api import PlayerAPIClient | ||
from sleeper.enum import Sport, TrendType | ||
from sleeper.model import Player, PlayerTrend | ||
from sleeper.api.player import get_all_players, get_trending_players | ||
|
||
if __name__ == "__main__": | ||
# get all players in a particular sport | ||
nfl_players: dict[str, Player] = PlayerAPIClient.get_all_players(sport=Sport.NFL) | ||
nfl_players = get_all_players(sport="nfl") | ||
|
||
# get all trending players that were added for a particular sport | ||
nfl_added_trending_players: list[PlayerTrend] = ( | ||
PlayerAPIClient.get_trending_players(sport=Sport.NFL, trend_type=TrendType.ADD) | ||
) | ||
# get players that are trending up in the nfl | ||
nfl_trending_up_players = get_trending_players(sport="nfl", trend_type="add") | ||
|
||
# get all trending players that were dropped for a particular sport | ||
nfl_dropped_trending_players: list[PlayerTrend] = ( | ||
PlayerAPIClient.get_trending_players(sport=Sport.NFL, trend_type=TrendType.DROP) | ||
) | ||
# get players that are trending down in the nfl | ||
nfl_trending_down_players = get_trending_players(sport="nfl", trend_type="drop") |
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 |
---|---|---|
@@ -1,9 +1,8 @@ | ||
from sleeper.api import UserAPIClient | ||
from sleeper.model import User | ||
from sleeper.api.user import get_user | ||
|
||
if __name__ == "__main__": | ||
# get a user by username | ||
user_1: User = UserAPIClient.get_user(username="my_username") | ||
user_1 = get_user(identifier="my_username") | ||
|
||
# get a user by ID | ||
user_2: User = UserAPIClient.get_user(user_id="my_user_id") | ||
user_2 = get_user(identifier="my_user_id") |