Getting Started¶
Setup and Installation¶
-
Clone the repository:
-
Install
task
: Follow the instructions at taskfile.dev/installation to installtask
. -
Install
python3 & pip
: Follow the instructions at python.org to installpython3
andpip
.
Configuration¶
To use the Gemini API, you need to configure your API key.
-
Obtain an API key from Google AI Studio: https://aistudio.google.com/app/apikey
To ensure the Google CLI utilizes the
AGENTS.md
files for context, add the following to your~/.gemini/settings.json
file:
To use the OpenAI API, you need to configure your API key.
-
Obtain an API key from OpenAI: https://platform.openai.com/account/api-keys
-
Find your
LEAGUE_ID
from the URL of your ESPN fantasy football league. -
Find your
ESPN_S2
andSWID
cookies from your browser after logging into your ESPN account. See this discussion. -
Create a
.env
file from the template: -
Add your API key and ESPN credentials to the
.env
file:
Usage¶
-
Bootstrap the project: This command will create a virtual environment, install all the necessary dependencies, and guide you through selecting your team.
Options¶
-
Customize Scoring Rules (Optional): The project includes a
config.yaml
file in the root directory. You can modify this file to adjust the fantasy football scoring rules to match your league's settings. This allows for flexible customization without changing the Python code.Alternatively, you can run the following command to automatically fetch the scoring rules from your league and update
config.yaml
: -
Configure AI Provider (Optional): The
config.yaml
file also allows you to specify which AI provider to use (Gemini or OpenAI) and, for OpenAI, the specific model name.For a list of available OpenAI models, refer to the OpenAI Models documentation.# config.yaml example ai_provider: "gemini" # or "openai" openai_model_name: "gpt-4" # or other OpenAI model name
-
Configure Year Settings (Optional): The
config.yaml
file also contains fields foryear
anddata_years
under theleague_settings
section.year
: This field specifies the current year for your fantasy football league. It is used to fetch the correct league data.data_years
: This is a list of years for which to download player stats. By default, it's set to the current and previous year.
You can manually edit these fields in
config.yaml
to match your needs.
ADP Data¶
The project uses Average Draft Position (ADP) data for draft strategy and player valuation. This data is automatically downloaded when you run task download_adp
.
This will fetch the latest ADP data and save it to data/player_adp.csv
.