How to use the yfpy.models.StatCategories 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.code = self.extracted_data.get("code", "")
        self.game_id = self.extracted_data.get("game_id", "")
        self.game_key = self.extracted_data.get("game_key", "")
        self.game_weeks = self.extracted_data.get("game_weeks", "")
        self.is_game_over = self.extracted_data.get("is_game_over", "")
        self.is_live_draft_lobby_active = self.extracted_data.get("is_live_draft_lobby_active", "")
        self.is_offseason = self.extracted_data.get("is_offseason", "")
        self.is_registration_over = self.extracted_data.get("is_registration_over", "")
        self.leagues = self.extracted_data.get("leagues", [])
        self.name = self.extracted_data.get("name", "")
        self.position_types = self.extracted_data.get("position_types", [])
        self.roster_positions = self.extracted_data.get("roster_positions", [])
        self.season = self.extracted_data.get("season", "")
        self.stat_categories = self.extracted_data.get("stat_categories", StatCategories({}))  # type: StatCategories
        self.teams = self.extracted_data.get("teams", [])
        self.type = self.extracted_data.get("type", "")
        self.url = self.extracted_data.get("url", "")
github uberfastman / yfpy / yfpy / query.py View on Github external
},
                    ...,
                    {
                      "stat": {
                        "display_name": "Rush 1st Downs",
                        "name": "Rushing 1st Downs",
                        "sort_order": "1",
                        "stat_id": 81
                      }
                    }
                  ]
                }
        """
        return self.query(
            "https://fantasysports.yahooapis.com/fantasy/v2/game/" + str(game_id) + "/stat_categories",
            ["game", "stat_categories"], StatCategories)