cdleong / pyfantasy

Not Playing Fantasy Sports
GNU General Public License v3.0
1 stars 0 forks source link

Read in league number so the code gets league-specific stats #23

Closed cdleong closed 4 years ago

cdleong commented 5 years ago

In the feature/explore_data branch, I pulled down league-specific stats using the league number:

    def league_specific_query(self, subquery="", league_number=None,):
        '''
        Returns an XML string
        :param subquery:
        :param league_number:
        see also https://developer.yahoo.com/fantasysports/guide/players-collection.html
        and https://developer.yahoo.com/fantasysports/guide/league-resource.html#league-resource-key_format
        'league/{league_key}/players'
        so for example "league/nfl.l.42"
        '''
        if not league_number:
            league_number = input("League number is: ")
        query = "league/nfl.l." + str(league_number) + subquery  # get league info

        return self.query_yahoo(query)

I need to either prompt the user, or read in a config file, or something.

cdleong commented 5 years ago

There's a lot of general code cleanup that needs to happen, I think. But anyway I got this part done, I think.