How to use the yfpy.models.DraftAnalysis function in yfpy

To help you get started, we’ve selected a few yfpy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github uberfastman / yfpy / yfpy / models.py View on Github external
def __init__(self, extracted_data):
        YahooFantasyObject.__init__(self, extracted_data)
        self.bye_weeks = self.extracted_data.get("bye_weeks", ByeWeeks({}))  # type: ByeWeeks
        self.bye = self.bye_weeks.week
        self.display_position = self.extracted_data.get("display_position", "")
        self.draft_analysis = self.extracted_data.get("draft_analysis", DraftAnalysis({}))  # type: DraftAnalysis
        self.average_draft_pick = self.draft_analysis.average_pick
        self.average_draft_round = self.draft_analysis.average_round
        self.average_draft_cost = self.draft_analysis.average_cost
        self.percent_drafted = self.draft_analysis.percent_drafted
        self.editorial_player_key = self.extracted_data.get("editorial_player_key", "")
        self.editorial_team_abbr = self.extracted_data.get("editorial_team_abbr", "")
        self.editorial_team_full_name = self.extracted_data.get("editorial_team_full_name", "")
        self.editorial_team_key = self.extracted_data.get("editorial_team_key", "")
        self.eligible_positions = self.extracted_data.get("eligible_positions", "")
        self.has_player_notes = self.extracted_data.get("has_player_notes", "")
        self.headshot = self.extracted_data.get("headshot", Headshot({}))  # type: Headshot
        self.headshot_size = self.headshot.size
        self.headshot_url = self.headshot.url
        self.is_editable = self.extracted_data.get("is_editable", "")
        self.is_undroppable = self.extracted_data.get("is_undroppable", "")
        self.name = self.extracted_data.get("name", Name({}))  # type: Name