From 9ef333ef44b2e1b9c6fbf01b873e12f1e3c74a12 Mon Sep 17 00:00:00 2001 From: joeyagreco Date: Wed, 11 Sep 2024 20:14:34 -0400 Subject: [PATCH] more examples --- example/draft_example.py | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/example/draft_example.py b/example/draft_example.py index 2a64f3e..74a2a74 100644 --- a/example/draft_example.py +++ b/example/draft_example.py @@ -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")