Replies: 1 comment
-
Interesting question - there's not really a direct way to do it I'm afraid, most of those
It sounds like you're wondering about player performance dumps so here's the method where this happens as well as a code snippet that might help from yahoofantasy.cli.dump import _get_results
results = []
league = ctx.get_leagues('nfl', 2022)[0] # consider replacing with your league object
for week in league.weeks():
if week.week_num > league.current_week or week.matchups[0].status != 'postevent':
continue
for matchup in week.matchups:
results.extend(_get_results(matchup.team1, week.week_num))
results.extend(_get_results(matchup.team2, week.week_num)) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am probably just not seeing how it works properly, but is there a way to run the performances dump from within package? The issue I am running into is that I am trying to run 'yahoofantasy dump ....' command from a python os.system() command, which cannot accept user inputs, inserting which league you want to gather the performances for.
Can I run this somehow from the package where I can give it which league I want the dump for? Does it always return a file, or can it return a dataframe in session?
Beta Was this translation helpful? Give feedback.
All reactions