|
41 | 41 | # VARIABLE SETUP # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
42 | 42 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
43 | 43 |
|
| 44 | + |
44 | 45 | # set desired season year
|
45 |
| -season = 2021 |
46 |
| -# season = 2012 |
| 46 | +def get_season(): |
| 47 | + # season = 2012 |
| 48 | + # season = 2013 |
| 49 | + # season = 2014 |
| 50 | + # season = 2015 |
| 51 | + # season = 2016 |
| 52 | + # season = 2017 |
| 53 | + # season = 2018 |
| 54 | + # season = 2019 |
| 55 | + # season = 2020 |
| 56 | + # season = 2021 |
| 57 | + # season = 2022 |
| 58 | + season = 2023 |
| 59 | + return season |
| 60 | + |
| 61 | + |
| 62 | +season = get_season() |
| 63 | + |
47 | 64 |
|
48 | 65 | # set desired week
|
49 |
| -chosen_week = 1 |
| 66 | +def get_chosen_week(): |
| 67 | + chosen_week = 1 |
| 68 | + return chosen_week |
| 69 | + |
| 70 | + |
| 71 | +chosen_week = get_chosen_week() |
| 72 | + |
50 | 73 |
|
51 | 74 | # set desired date
|
52 |
| -chosen_date = "2013-04-15" # NHL - 2013 (for 2012) |
53 |
| -# chosen_date = "2013-04-16" # NHL - 2013 |
54 |
| -# chosen_date = "2021-10-25" # NHL - 2021 |
55 |
| -# chosen_date = "2021-04-01" # MLB - 2021 |
56 |
| -# chosen_date = "2022-04-10" # MLB - 2022 |
| 75 | +def get_chosen_date(): |
| 76 | + # HOCKEY |
| 77 | + # chosen_date = "2013-04-15" # NHL - 2013 (for 2012 season) |
| 78 | + chosen_date = "2021-10-25" # NHL - 2021 |
| 79 | + |
| 80 | + # BASEBALL |
| 81 | + # chosen_date = "2021-04-01" # MLB - 2021 |
| 82 | + # chosen_date = "2022-04-10" # MLB - 2022 |
| 83 | + |
| 84 | + return chosen_date |
| 85 | + |
| 86 | + |
| 87 | +chosen_date = get_chosen_date() |
| 88 | + |
57 | 89 |
|
58 | 90 | # set desired Yahoo Fantasy Sports game code
|
59 |
| -game_code = "nfl" # NFL |
60 |
| -# game_code = "nhl" # NHL |
61 |
| -# game_code = "mlb" # MLB |
| 91 | +def get_game_code(): |
| 92 | + # FOOTBALL |
| 93 | + game_code = "nfl" # NFL |
| 94 | + |
| 95 | + # HOCKEY |
| 96 | + # game_code = "nhl" # NHL |
| 97 | + |
| 98 | + # BASEBALL |
| 99 | + # game_code = "mlb" # MLB |
| 100 | + |
| 101 | + return game_code |
| 102 | + |
| 103 | + |
| 104 | +game_code = get_game_code() |
| 105 | + |
62 | 106 |
|
63 | 107 | # set desired Yahoo Fantasy Sports game ID (see the get_all_yahoo_fantasy_game_keys query to retrieve values)
|
64 |
| -# game_id = 331 # NFL - 2014 |
65 |
| -# game_id = 348 # NFL - 2015 (testing for league with divisions) |
66 |
| -# game_id = 390 # NFL - 2019 |
67 |
| -# game_id = 399 # NFL - 2020 |
68 |
| -game_id = 406 # NFL - 2021 |
69 |
| -# game_id = 303 # NHL - 2012 |
70 |
| -# game_id = 411 # NHL - 2021 |
71 |
| -# game_id = 404 # MLB - 2021 |
72 |
| -# game_id = 412 # MLB - 2022 |
| 108 | +def get_game_id(): |
| 109 | + # FOOTBALL |
| 110 | + # game_id = 331 # NFL - 2014 |
| 111 | + # game_id = 348 # NFL - 2015 (divisions) |
| 112 | + # game_id = 359 # NFL - 2016 |
| 113 | + # game_id = 371 # NFL - 2017 |
| 114 | + # game_id = 380 # NFL - 2018 |
| 115 | + # game_id = 390 # NFL - 2019 |
| 116 | + # game_id = 399 # NFL - 2020 |
| 117 | + # game_id = 406 # NFL - 2021 |
| 118 | + # game_id = 414 # NFL - 2022 (divisions) |
| 119 | + game_id = 423 # NFL - 2023 |
| 120 | + |
| 121 | + # HOCKEY |
| 122 | + # game_id = 303 # NHL - 2012 |
| 123 | + # game_id = 411 # NHL - 2021 |
| 124 | + |
| 125 | + # BASEBALL |
| 126 | + # game_id = 404 # MLB - 2021 |
| 127 | + # game_id = 412 # MLB - 2022 |
| 128 | + |
| 129 | + return game_id |
| 130 | + |
| 131 | + |
| 132 | +game_id = get_game_id() |
| 133 | + |
73 | 134 |
|
74 | 135 | # set desired Yahoo Fantasy Sports game key (see the get_all_yahoo_fantasy_game_keys query to retrieve values)
|
75 |
| -# game_key = "331" # NFL - 2014 |
76 |
| -# game_key = "348" # NFL - 2015 (testing for league with divisions) |
77 |
| -# game_key = "390" # NFL - 2019 |
78 |
| -# game_key = "399" # NFL - 2020 |
79 |
| -game_key = "406" # NFL - 2021 |
80 |
| -# game_key = "303" # NHL - 2012 |
81 |
| -# game_key = "411" # NHL - 2021 |
82 |
| -# game_key = "404" # MLB - 2021 |
83 |
| -# game_key = "412" # MLB - 2022 |
| 136 | +def get_game_key(): |
| 137 | + # FOOTBALL |
| 138 | + # game_key = "331" # NFL - 2014 |
| 139 | + # game_key = "348" # NFL - 2015 (divisions) |
| 140 | + # game_key = "359" # NFL - 2016 |
| 141 | + # game_key = "371" # NFL - 2017 |
| 142 | + # game_key = "380" # NFL - 2018 |
| 143 | + # game_key = "390" # NFL - 2019 |
| 144 | + # game_key = "399" # NFL - 2020 |
| 145 | + # game_key = "406" # NFL - 2021 |
| 146 | + # game_key = "414" # NFL - 2022 (divisions) |
| 147 | + game_key = "423" # NFL - 2023 |
| 148 | + |
| 149 | + # HOCKEY |
| 150 | + # game_key = "303" # NHL - 2012 |
| 151 | + # game_key = "411" # NHL - 2021 |
| 152 | + |
| 153 | + # BASEBALL |
| 154 | + # game_key = "404" # MLB - 2021 |
| 155 | + # game_key = "412" # MLB - 2022 |
| 156 | + |
| 157 | + return game_key |
| 158 | + |
| 159 | + |
| 160 | +game_key = get_game_key() |
| 161 | + |
84 | 162 |
|
85 | 163 | # set desired league ID (see README.md for finding value)
|
86 |
| -# league_id = "907359" # NFL - 2015 (testing for league with divisions) |
87 |
| -# league_id = "79230" # NFL - 2019 |
88 |
| -# league_id = "655434" # NFL - 2020 |
89 |
| -league_id = "413954" # NFL - 2021 |
90 |
| -# league_id = "69624" # NHL - 2012 |
91 |
| -# league_id = "101592" # NHL - 2021 |
92 |
| -# league_id = "40134" # MLB - 2021 |
| 164 | +def get_league_id(): |
| 165 | + # FOOTBALL |
| 166 | + # league_id = "907359" # NFL - 2015 (divisions) |
| 167 | + # league_id = "79230" # NFL - 2019 |
| 168 | + # league_id = "655434" # NFL - 2020 |
| 169 | + # league_id = "413954" # NFL - 2021 |
| 170 | + # league_id = "791337" # NFL - 2022 (divisions) |
| 171 | + league_id = "321958" # NFL - 2023 |
| 172 | + |
| 173 | + # HOCKEY |
| 174 | + # league_id = "69624" # NHL - 2012 |
| 175 | + # league_id = "101592" # NHL - 2021 |
| 176 | + |
| 177 | + # BASEBALL |
| 178 | + # league_id = "40134" # MLB - 2021 |
| 179 | + |
| 180 | + return league_id |
| 181 | + |
| 182 | + |
| 183 | +league_id = get_league_id() |
| 184 | + |
93 | 185 |
|
94 | 186 | # set desired team ID within desired league
|
95 |
| -team_id = 1 # NFL |
96 |
| -# team_id = 2 # NHL (2012) |
| 187 | +def get_team_id(): |
| 188 | + # FOOTBALL |
| 189 | + team_id = 1 # NFL |
| 190 | + |
| 191 | + # HOCKEY |
| 192 | + # team_id = 2 # NHL (2012) |
| 193 | + |
| 194 | + return team_id |
| 195 | + |
| 196 | + |
| 197 | +team_id = get_team_id() |
| 198 | + |
97 | 199 |
|
98 | 200 | # set desired team name within desired league
|
99 |
| -team_name = "Legion" # NFL |
100 |
| -# team_name = "The Bateleurs" # NHL (2012) |
| 201 | +def get_team_name(): |
| 202 | + # FOOTBALL |
| 203 | + team_name = "Legion" # NFL |
| 204 | + |
| 205 | + # HOCKEY |
| 206 | + # team_name = "The Bateleurs" # NHL (2012) |
| 207 | + |
| 208 | + return team_name |
| 209 | + |
| 210 | + |
| 211 | +team_name = get_team_name() |
| 212 | + |
101 | 213 |
|
102 | 214 | # set desired team ID within desired league
|
103 |
| -player_id = 7200 # NFL: Aaron Rodgers - 2020/2021 |
104 |
| -# player_id = 4588 # NHL: Braden Holtby - 2012 |
105 |
| -# player_id = 8205 # NHL: Jeffrey Viel - 2021 |
106 |
| -# player_id = 3637 # NHL: Alex Ovechkin - 2021 |
107 |
| -# player_id = 9897 # MLB: Tim Anderson - 2021/2022 |
| 215 | +def get_player_id(): |
| 216 | + # FOOTBALL |
| 217 | + player_id = 30123 # NFL: Patrick Mahomes - 2020/2021/2023 |
| 218 | + |
| 219 | + # HOCKEY |
| 220 | + # player_id = 4588 # NHL: Braden Holtby - 2012 |
| 221 | + # player_id = 8205 # NHL: Jeffrey Viel - 2021 |
| 222 | + # player_id = 3637 # NHL: Alex Ovechkin - 2021 |
| 223 | + |
| 224 | + # BASEBALL |
| 225 | + # player_id = 9897 # MLB: Tim Anderson - 2021/2022 |
| 226 | + |
| 227 | + return player_id |
| 228 | + |
| 229 | + |
| 230 | +player_id = get_player_id() |
| 231 | + |
108 | 232 |
|
109 | 233 | # set the maximum number players you wish the get_league_players query to retrieve
|
110 |
| -league_player_limit = 101 |
111 |
| -# league_player_limit = 2610 |
| 234 | +def get_league_player_limit(): |
| 235 | + league_player_limit = 101 |
| 236 | + |
| 237 | + return league_player_limit |
| 238 | + |
| 239 | + |
| 240 | +league_player_limit = get_league_player_limit() |
112 | 241 |
|
113 | 242 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
114 | 243 | # QUERY SETUP # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
|
0 commit comments