Skip to content

knix24/sleeper-tenure-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Sleeper Dynasty Tenure Tracker

A command-line tool that calculates how many consecutive seasons each player has been kept (not drafted) while remaining on a roster in your Sleeper fantasy football league.

What It Does

For dynasty and keeper leagues, this tool analyzes your league's history and shows each player's projected tenure for the upcoming season:

Column Description
Player Player's name
Pos Position
Owner Current roster owner
Tenure (YEAR) Projected tenure for next season if kept

How Tenure Is Calculated

Tenure is a league-wide concept tracking how many consecutive seasons a player has avoided the draft while remaining rostered.

Tenure resets to 0 when:

  • Player is drafted by any team
  • Player is not on any week 1 roster (dropped/not kept)

Tenure increments (+1) when:

  • Player is on any team's week 1 roster
  • Player was NOT drafted that season
  • Player was in the league the previous season

Example

Season Event Tenure
2022 Drafted by Team A 0
2023 Kept by Team B (traded mid-season) 1
2024 Kept by Team B 2
2025 Drafted by Team C 0 (reset)

Installation

Requires Python 3.9+ and the requests library.

git clone https://github.com/knix24/sleeper-tenure-tracker.git
cd sleeper-tenure-tracker
pip install requests

Usage

python tenure_tracker.py <sleeper_username> [season] [options]

Arguments:

  • sleeper_username: Your Sleeper username (or any league member)
  • season: (optional) Season year, defaults to current year

Options:

  • --csv: Output in CSV format (for spreadsheets)
  • --refresh: Force refresh of cached player database
  • --league N: Select league number N (skips prompt when user has multiple leagues)
  • -h, --help: Show help message

Example Output

Fetching data for gridiron_guy... OK
League: Pigskin Prophets Dynasty
Tracing league history... OK (4 seasons: 2022, 2023, 2024, 2025)
Calculating tenure... OK
Fetching current rosters... OK
Fetching player database... OK (cached)

Player               Pos  Owner           Tenure (2026)
========================================================
Josh Jacobs          RB   thunderfoot                  4
Amon-Ra St. Brown    WR   thunderfoot                  4
Jahmyr Gibbs         RB   thunderfoot                  3
Bucky Irving         RB   thunderfoot                  2
...
Courtland Sutton     WR   redzone_rick                 3
Chase Brown          RB   redzone_rick                 2

Total players with tenure greater than 1: 53

Results are sorted by owner (ascending), then by tenure (descending).

How It Works

  1. Looks up the user and finds their leagues for the specified season
  2. Traces the league's history back through all previous seasons (via previous_league_id)
  3. For each season:
    • Fetches draft picks to identify drafted players
    • Fetches week 1 matchups to get rosters at season start
  4. Calculates tenure chronologically from oldest to newest season:
    • Players drafted get tenure = 0
    • Players kept (on week 1 roster, not drafted, were in league previous season) get tenure + 1
    • Players not on any week 1 roster get tenure reset to 0
  5. Displays projected tenure for the next season (current tenure + 1) for all currently rostered keepers

Notes

  • If you have multiple leagues, the tool prompts you to select one (use --league N to skip the prompt)
  • Player database is cached locally for 24 hours (~/.cache/sleeper-tenure-tracker/)
  • Use --refresh if you notice outdated player names in the output
  • Friendly error messages are shown if the API fails or a user/league isn't found

API

This tool uses the Sleeper API which is free and requires no authentication.

About

CLI tool to track player tenure in Sleeper fantasy football dynasty/keeper leagues

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages