Eric Jadallah / Projects

Fantasy lineup model

A daily lineup optimizer and injury watcher for a 12-team Yahoo fantasy basketball league. It pulls my league from Yahoo and the NBA schedule and injury list from ESPN. It could fill my lineup for me, but it's really best for the data analysis that would be tedious by hand. A free agent might be better because he plays on a day my stars don't. He might suddenly have a bigger role because of an injury. Rather than watching Shams' Twitter all day to stay competitive, Claude compiles the news so a decision is easy.

This is a demo: real roster, stats and schedule from late October 2026, with the league's team names replaced. Tap a day on the calendar to see how it works.

Lineup board

12-team Yahoo league · head-to-head points · daily lineups

How it works

  1. Data. Rosters, free agents and fantasy points come from Yahoo's API. The NBA schedule, the daily injury list and the news feed come from ESPN's public endpoints. Everything is cached as JSON, so a run takes seconds (and stays cheap).
  2. Lineup model. For every day left in the season, the players with a game get matched to my PG, SG, SF, PF, C and three Util spots, best player first. It's a bipartite matching problem - the same math as assigning workers to jobs. A player's value is what he's actually scored per game over the last week. If there isn't enough of that, it falls back to his season average and then to my preseason projection. What comes out is a count of open spots and benched games for every day, which is what the calendar shows.
  3. Free-agent fit. A free agent only gets credit for days where he has a game, I have an open spot, and he's eligible for that spot. Points added is those days he can play times his points per game. So a mediocre player who plays on the right nights can beat a star who only plays when my lineup is already full.
  4. Injury watcher. Every 30 minutes a job checks ESPN's news. A small, cheap model (Claude Haiku) reads each headline and decides if it matters to my league. Most don't. When one does, a bigger model (Claude Opus, with web search) writes the advice: what to do with the hurt player, who picks up his minutes, who to add and drop, and a guess at when he's back. That return date feeds back into the schedule model.
  5. Delivery. GitHub Actions runs the watcher, a morning report and a check before tip-off. Advice is pushed to my phone through ntfy with a one-paragraph summary and a link to the full report, and every report is committed back to the repo. This keeps the model both smart and up to date. Fantasy basketball is an insane time commitment, and this lets me spend as much or as little time on it as I want.
  6. Draft board. The second tab is the auction-day tool the project started as: a live price board with the room's remaining money, a value model with injury and role adjustments, and a shared sale log. I fed this data straight to Claude through /loop so it kept an understanding of my bids as the auction went on. The goal wasn't to collect stars - my league overbids on the players they love to watch - but to collect sleepers: role players who are suddenly going to get a lot more ball time. A $10 player who suddenly plays like a $20 player often goes unseen, but the data (and news deciphered into data) lets us make good guesses.

Built in Python with no framework, using the Anthropic SDK, Yahoo and ESPN data, ntfy for phone alerts, and GitHub Actions to run it all. The page itself is one HTML file.