A cleaner, more maintainable fantasy football reporting tool for ESPN leagues.
- Python 3.9+
- Weekly reports with detailed statistics
- Box scores with analysis of bench scoring and "what could have been" scenarios
- League standings and power rankings
- Points per player per position analysis
- LLM-generated weekly summaries
- Clean HTML reports with consistent styling
- Easy to run from the command line
- Clone this repository
- Install from Source with dependencies:
# for a regular installation
pip install .# or install in development mode
pip install -e .- Create a
.envfile with your ESPN API credentials (use.env.exampleas a template)
# Using the run script
./run.sh
# Or using the CLI
ff weekly --openff weekly --week 10 --openff generate-all --start 1 --end 17Usage: ff [OPTIONS] COMMAND [ARGS]...
Fantasy Football CLI application for generating reports and statistics.
Options:
--help Show this message and exit.
Commands:
generate-all Generate reports for all weeks in a range.
weekly Generate a weekly fantasy football report.
Weekly command options:
--year, -y INTEGER NFL season year to generate report for
--week, -w INTEGER NFL week to generate report for (0 for current week)
--output, -o TEXT Output file path (defaults to YEAR-weekWEEK.html)
This project uses a Makefile to simplify common tasks.
To generate a report for a specific week and view it in your browser, use the preview command. A local web server will be started.
make preview WEEK=3This is equivalent to running:
./build.sh --week 3To create a production-ready build in the dist/ directory, use the build command. This will generate all reports and assets needed for deployment.
make buildThis is equivalent to running:
./build.sh buildThe Makefile also includes a deploy target to sync the dist/ directory to a remote server using rsync. You will need to configure the destination in the Makefile.
make deploypip uninstall fantasy-football-reports
The packages setup.py have to be removed individually.
ff/- Main package directory__main__.py- CLI entry pointconfig.py- Configuration handlingdata.py- ESPN API data retrievalllm_report.py- LLM-based report generationreports.py- Report generationstats.py- Statistical calculationstemplates.py- HTML template handling
templates/- Jinja2 HTML templatesbuild.sh- Unified script for building and previewing reportsMakefile- Makefile for common development tasksrun.sh- Convenience script for running the application
You can customize the report by:
- Editing the Jinja2 templates in the
templates/directory - Adjusting the CSS styles in the base template
- Adding new statistical calculations to
stats.py - Creating new report types in
reports.py
