Skip to content

💻 Usage

This project uses Taskfile.yml to define and run tasks. You can see a list of all available tasks by running task -l.

task-list.txt
task: Available tasks for this project:
* analyze_last_game:              Analyze your last fantasy football game and get improvement suggestions
* analyze_next_game:              Analyze your next fantasy football game and get suggestions to win
* bootstrap:                      Bootstrap the project
* build:                          Build the Dockerfile
* compare_fantasy_players:        Compare fantasy football players side-by-side
* compare_roster_positions:       Compare roster settings with actual team composition
* decrypt:                        Decrypt secret and environment files using sops.
* deps:                           Install Python dependencies
* docker:                         Run a task inside the Docker container
* download_adp:                   Download Average Draft Position (ADP) data
* download_player_data:           Download player data from Sleeper API
* download_weekly_stats:          Download NFL player stats. Defaults to years specified in config.yaml. Usage: task download_weekly_stats -- --years 2022 2023
* draft_prep:                     Download data and create a draft strategy
* encrypt:                        Encrypt secret and environment files using sops.
* export:                         Export the list of available tasks to task-list.txt.
* generate_report:                Generate a Markdown report from the analysis
* generate_terminal_report:       Output the analysis report to the terminal
* get_available_players:          Get available players from your league and create available_players.csv
* get_league_settings:            Get your league settings
* get_my_team_roster:             Get your fantasy football team and create my_team.md
* gflash:                         Run Gemini with the gemini-2.5-flash model.
* glite:                          Run Gemini with the gemini-2.5-flash-lite model.
* gpro:                           Run Gemini with the gemini-2.5-pro model.
* identify_my_team:               Identify your team and save it to config.yaml
* init:                           Initialize the project by creating environment file from templates.
* lint:                           Lint the code with flake8
* live_draft_assistant:           Run the interactive live draft assistant
* render_html_report:             Render the generated Markdown report to HTML and open in browser
* run:                            Run the Dockerfile
* run_ai_assistant:               Interact with the Fantasy Football AI assistant.
* serve:                          Serve the documentation locally using Docker.
* shell:                          Open a shell inside the Docker container
* suggest_pickups:                Get pickup recommendations based on available players and team needs
* suggest_trades:                 Get trade suggestions based on player stats
* test:                           Run unit tests
* update:                         Update Docker container
* weekly_update:                  Run the full weekly update: download stats, update team, get available players, analyze, get suggestions, and generate report.

⬇ Download Weekly Player Stats

To download the latest player stats (defaulting to the 2023 and 2024 seasons), run the following command:

task download_weekly_stats

You can also specify the years to download by passing the --years argument:

task download_weekly_stats -- --years 2022 2023

This will create a player_stats.csv file in the data/ directory.

📋 Get Available Players

To get a list of available players for weekly pickups, run the following command:

task get_available_players

This will create an available_players.csv file in the data/ directory.

👤 Identify My Team

To select your team from a list of all teams in the league, run the following command:

task identify_my_team

You will be prompted to enter the number corresponding to your team from the list. This will save your team's ID to the my_team_id field in the config.yaml file, so the other scripts know which team is yours.

📊 Get My Team Roster

To get your team's roster and create the my_team.md file, run the following command:

task get_my_team_roster

🎮 Analyze Last Game

To analyze your team's performance in the last game and get suggestions for improvement, run:

task analyze_last_game

This will provide an AI-generated analysis of your team's performance and actionable advice.

🏆 Analyze Next Game

To analyze your upcoming fantasy football game against an opponent and get strategic suggestions to win, run:

task analyze_next_game

This script will prompt you to enter your opponent's roster (comma-separated player names) and then provide an AI-generated analysis of strengths, weaknesses, key matchups, and strategic advice.

📃 Generate Report

To generate a comprehensive report with draft recommendations, bye week analysis, and trade suggestions, run:

task generate_report

This will create a Markdown report file in the docs/reports/posts/ directory, suitable for publishing with MkDocs.

💻 View Report in Terminal

To view the generated report directly in your terminal, run:

task generate_terminal_report

This will output the same comprehensive analysis to your command line, formatted for readability.

🎨 Render HTML Report

To render the generated Markdown report (reports/report.md) to an HTML file and open it in your default web browser, run:

task render_html_report

This will create a report.html file in the reports/ directory and automatically open it.

🌐 Publishing Reports

Reports generated by the AI can be published to the MkDocs Material site. This allows for easy sharing and viewing of the analysis.

To publish a report, ensure it is located in the docs/reports/posts/ directory with the correct YAML front matter. The MkDocs site will automatically include it as a blog post.

To build and serve the documentation site locally using Docker, run:

task serve

⚙ Get League Settings

To download your league's settings, run the following command:

task get_league_settings

🔎 Suggest Pickups

To get pickup recommendations based on available players, their performance, and your team's needs, run:

task suggest_pickups

🤝 Suggest Trades

To get trade suggestions based on the latest player stats, run:

task suggest_trades

💎 Identify Waiver Wire Gems

To identify players with high upside based on recent usage trends, even if their fantasy point output hasn't spiked yet, run:

task suggest_pickups

The output will include a separate section for "Waiver Wire Gems" with details on their recent usage and fantasy point averages compared to their season averages.

📋 Download ADP Data

To download the latest Average Draft Position (ADP) data from Fantasy Football Calculator, run:

task download_adp

This data is used by the live_draft_assistant and other scripts for player valuation.

📝 Live Draft Assistant

To run the interactive live draft assistant, which provides real-time suggestions based on VBD and team needs, run:

task live_draft_assistant

The assistant will prompt you to enter drafted players and will provide recommendations when it's your turn. You can type exit or quit at any prompt to end the session.

⭐ Optimal Lineup Generator

To generate an optimal fantasy football lineup based on projected points and your roster settings, run:

task lineup_optimizer

This will suggest the highest-scoring lineup for your team, considering all positional requirements.