Find a file
2024-09-30 23:30:07 -07:00
.gitea/workflow Git workflow with Dockerfile 2024-09-30 23:02:36 -07:00
.env-template Initial import 2024-09-25 23:33:34 -07:00
.gitignore Ignore service account credentials file 2024-09-28 16:30:39 -07:00
app.py Configure Redis with every morning 6 AM execution 2024-09-30 23:02:18 -07:00
config.py Added Spreadsheet ID and Worksheet Name for Google Sheets 2024-09-28 16:31:29 -07:00
Dockerfile Git workflow with Dockerfile 2024-09-30 23:02:36 -07:00
README.md Fix URL for cloning 2024-09-25 23:39:08 -07:00
requirements.txt Added huey and redis 2024-09-30 23:00:34 -07:00
service.py Add service file 2024-09-28 16:31:41 -07:00
wip.ipynb Added ability to write to Google Sheets and removed weekly override 2024-09-28 16:32:07 -07:00

ESPN Weekly Fantasy Football Report Generator

Generate a report using ESPN API for Python

Install

Required: Python 3.8 or greater

  • Clone this repository: git clone https://forgejo.digitalhippo.tech/digital-hippo-labs/wffrg
  • Create a virtual environment
    • cd wffrg
    • python -m venv .venv or python3 -m venv .venv
  • Activvate virtual environment
    • MacOS/Linux: . .venv/bin/active
    • Windows
      • Command Prompt: .venv\Scripts\activate.bat
      • Powershell: .venv\Scripts\activate.ps1
  • Install requirements
    • pip install -r requirements.txt

Configure

Copy .env-template as .env file and enter the following items:

  • ESPN_S2: S2 key from ESPN
  • SWID: SWID key from ESPN
  • LEAGUE_ID: League ID for your Fantasy League from ESPN
  • FETCH_LEAGE: Generally, leave as true unless you know what you're doing

For more information on how to retrieve these details, head on over to GitHub and review this discussion.

Execute

The following arguments are available and optional:

  • -wo or --weekly-override: Provide a week (as an int) to override data generation, default is current week.

For example, if the current week is week 10 but I want data from week 8:

  • python app.py -wo 8 or python app.py --weekly-override 8

Otherwise, for current week:

  • python app.py

End result will be a .csv file