This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
# Run directly (no install needed)
./sleeper-pixels <username>
# Or install with pip
pip install -e .
sleeper-pixels <username>
# Examples
./sleeper-pixels angus0024 --season 2024 --show-points
./sleeper-pixels angus0024 --season 2024 -p RB -p WR
./sleeper-pixels angus0024 --season 2024 --html output.html--season YEAR- NFL season year (default: current)--league ID- League ID (prompts if not provided)--week N- Max week to display (auto-detects from matchup data)--show-points- Display actual fantasy points instead of symbols-p, --position POS- Filter by position (QB, RB, WR, TE, K, DEF); repeatable--html FILE- Export to HTML file with hover tooltips
Python CLI tool that visualizes fantasy football roster performance using a GitHub-style pixel grid.
Data Flow:
cli.py- Entry point, orchestrates workflow, builds roster tenure dataapi.py- Fetches user, league, roster, and matchup data from Sleeper APIrankings.py- Calculates weekly positional rankings from matchup scoresgrid.py- Renders pixel grid (terminal via Rich, or HTML export)
Key Features:
- Auto-detects weeks with scoring data (doesn't rely on API state)
- Tracks roster tenure from matchup history (shows all players who were ever on roster)
- Blank cells = not on roster;
·= on roster but no stats; colored = performance tier
Visualization:
- Y-axis: Players (sorted by position: QB, RB, WR, TE, K, DEF)
- X-axis: Week numbers
- Colors: bright green (top 5), green (top 10), light green (top 15), gray (below)
- Base URL:
https://api.sleeper.app/v1 - No authentication required
- Rate limit: Stay under 1,000 calls/minute
- Player database (
/players/nfl) is ~5MB and cached via@lru_cache - Matchups contain
players_pointsdict mapping player_id to weekly score - Roster history derived from weekly matchup
playersarrays