A cross-platform CLI that fetches current fantasy football rankings (ESPN editorial to start), formats them into a clean, color-coded PDF, and saves locally. Designed for extension to other sources (Sleeper, Yahoo).
- Multiple scoring presets: PPR / Half-PPR / Standard
- Beautiful PDFs: header with title/scoring/date; footer with source + URL; auto page breaks; color-coded positions
- Fast and resilient: tolerant HTML parsing, graceful errors, and local caching
- Extensible providers: simple base class with ESPN editorial provider included; optional ESPN API / Sleeper ADP
- CLI UX: powered by Typer + Rich; supports CSV/raw output for piping
pipx install fantasy-ranks-pdfpython -m pip install fantasy-ranks-pdffantasy-ranks \
--source espn-editorial \
--scoring ppr \
--limit 300 \
--out ./ESPN_PPR_2025.pdfOptions:
--positions: CSV of positions to include, e.g.QB,RB,WR,TE,K,DST--include-bye/--no-bye: include bye week column--style:lightordark--open: open the generated PDF after export--raw: print CSV to stdout instead of PDF
Note: images are placeholders; actual screenshots to be added.
fantasy_ranks/
__init__.py
cli.py
models.py # PlayerRank model (Pydantic)
providers/
base.py # abstract Provider: fetch(scoring)->DataFrame
espn_editorial.py # tolerant editorial/cheat sheet scraper (bs4 + lxml)
espn_api.py # optional; projections if cookies provided
sleeper_adp.py # optional; Sleeper ADP for comparison
render/
pdf.py # fpdf2 renderer from DataFrame
utils/
caching.py # cache helpers (platformdirs)
tables.py # DataFrame table helpers
- Additional providers: Sleeper ADP, Yahoo
- Team logos (opt-in) with caching and toggle
- More styling presets and printable layouts
- Better heuristics for table/download sources
This project may scrape or process third-party content. Use it responsibly and in accordance with the source’s terms of use. The authors are not affiliated with ESPN, Yahoo, or Sleeper.
Please read CODE_OF_CONDUCT.md, CONTRIBUTING.md, and SECURITY.md.

