-
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
bd96e8a
commit 9ef333e
Showing
1 changed file
with
12 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,26 @@ | ||
from sleeper.api import DraftAPIClient | ||
from sleeper.api.draft import ( | ||
get_draft, | ||
get_drafts_in_league, | ||
get_player_draft_picks, | ||
get_traded_draft_picks, | ||
get_user_drafts_for_year, | ||
) | ||
from sleeper.enum import Sport | ||
from sleeper.model import Draft, DraftPick, PlayerDraftPick | ||
|
||
if __name__ == "__main__": | ||
# get all drafts that a user was in for a particular year | ||
user_drafts: list[Draft] = DraftAPIClient.get_user_drafts_for_year( | ||
user_drafts = get_user_drafts_for_year( | ||
user_id="my_user_id", sport=Sport.NFL, year="2020" | ||
) | ||
|
||
# get all drafts for a particular league | ||
league_drafts: list[Draft] = DraftAPIClient.get_drafts_in_league( | ||
league_id="my_league_id" | ||
) | ||
league_drafts = get_drafts_in_league(league_id="my_league_id") | ||
|
||
# get a draft by its ID | ||
draft: Draft = DraftAPIClient.get_draft(draft_id="my_draft_id") | ||
draft = get_draft(draft_id="my_draft_id") | ||
|
||
# get all draft picks for a particular draft | ||
draft_picks: list[PlayerDraftPick] = DraftAPIClient.get_player_draft_picks( | ||
draft_id="my_draft_id", sport=Sport.NFL | ||
) | ||
draft_picks = get_player_draft_picks(draft_id="my_draft_id", sport=Sport.NFL) | ||
|
||
# get all traded draft picks for a particular draft | ||
traded_draft_picks: list[DraftPick] = DraftAPIClient.get_traded_draft_picks( | ||
draft_id="my_draft_id" | ||
) | ||
traded_draft_picks = get_traded_draft_picks(draft_id="my_draft_id") |