Skip to main content
confpickem logo

confpickem - NFL Confidence Pick'em Analyzer

A Python package for analyzing and optimizing picks for NFL Confidence Pick'em pools. This package provides tools for: - Scraping Yahoo Pick'em league data - Analyzing pick distributions and trends - Simulating outcomes and optimizing picks - Evaluating different picking strategies

Installation

You can install the package using pip:

pip install confpickem

Quick Start

The easiest way to use confpickem is through the command-line tools:

# Optimize your picks (analytical optimizer, runs in seconds)
confpickem --week 10 --mode beginning

# Re-optimize once games start -- locks what's finished or kicked off
confpickem --week 10 --mode midweek

# Check win probabilities for all players
confpickem-win-probability --week 10 --live-odds

# Update player skills from historical data
confpickem-player-skills update --years 2024,2025

New here? docs/USAGE.md walks through a full week end to end (getting cookies.txt, the weekly run, reading the output).

Installation: Install the package to get these commands:

pip install -e .   # From project root

See the CLI Documentation for full details.

Python API

import json
from confpickem import YahooPickEm, ConfidencePickEmSimulator, Player
from confpickem.yahoo_pickem_integration import convert_yahoo_to_simulator_format

yahoo = YahooPickEm(week=10, league_id=YOUR_LEAGUE_ID, cookies_file='cookies.txt')

sim = ConfidencePickEmSimulator(num_sims=2000)
sim.add_games_from_dataframe(convert_yahoo_to_simulator_format(yahoo, ignore_results=True))

skills = json.load(open('current_player_skills.json'))   # or {} for average skills
sim.players = [
    Player(nm,
           skills.get(nm, {}).get('skill_level', 0.6),
           skills.get(nm, {}).get('crowd_following', 0.5),
           skills.get(nm, {}).get('confidence_following', 0.5))
    for nm in yahoo.players['player_name']
]

picks = sim.optimize_picks_analytic("Your Yahoo Name", verbose=True)
print(picks)   # {TEAM: confidence}, a full 1..N assignment

See examples/yahoo_pickem_demo.ipynb for the full flow (sanity checks, game importance, mid-week re-optimization).

Features

🎯 Unified CLI Tools

  • optimize.py - Comprehensive pick optimization with live odds support
  • win_probability.py - Monte Carlo win probability calculator
  • player_skills.py - Historical performance analysis and skill modeling

📊 Yahoo Data Scraping

  • Scrape pick distributions and crowd confidence levels
  • Track actual picks and results from your league
  • Cache responses to avoid excessive requests

🎲 Simulation and Analysis

  • Monte Carlo simulation of game outcomes
  • Player skill modeling and analysis
  • Pick optimization algorithms
  • Risk/reward and game importance analysis

🔴 Live Vegas Odds Integration

  • Real-time betting line integration via The Odds API
  • More accurate win probabilities than Yahoo spreads
  • Automatic fallback to Yahoo data when API unavailable

🧠 Strategy Optimization

  • Analytical Poisson-binomial P(win) optimizer (default; noise-free, runs in seconds)
  • Optimize confidence point assignments
  • Mid-week / mid-Sunday re-optimization — locks games already finished or kicked off
  • --greedy / --hill-climb for the older simulation-based optimizers

Dependencies

  • Python ≥ 3.8
  • requests
  • pandas
  • numpy
  • beautifulsoup4
  • scipy

Methodology

The pick optimizer computes your probability of winning the week analytically (the weekly score is a Poisson-binomial distribution) rather than by Monte Carlo simulation. This matters: a naive hill climb on simulated win probability optimizes noise, not strategy, and never beats "pick the favorites." The analytical objective is noise-free, ~250× faster to evaluate, and in a 29-week backtest produced 2 outright weekly wins vs. the greedy optimizer's 1, at a mean finish of 34th vs. 43rd.

This is the default optimizer (confpickem --week N --mode beginning). It handles mid-week runs too — games already finished or kicked off are locked to your submitted picks and the rest optimized around them. Pass --greedy for the old sequential optimizer or --hill-climb for the slower simulation search.

See docs/optimization-methodology.md for the full write-up.

Documentation

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for confpickem 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for confpickem 0.4.0
File Size Uploaded
confpickem-0.4.0.tar.gz 687.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for confpickem 0.4.0
File Interpreter ABI Platform
confpickem-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 777.9 kB

Release files / confpickem-0.4.0.tar.gz

Download URL confpickem-0.4.0.tar.gz
Size 687.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7bd4a19733e5352a446acde6bf48d2ba773f2af3350c5b3dfbd294558f094f6e
BLAKE2b-256 checksum
How to use checksums
5d4a5d030b7c372f1420785510abcac26dffb4cb9d7bed931b7fbc74bbdf5df1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / confpickem-0.4.0-py3-none-any.whl

Download URL confpickem-0.4.0-py3-none-any.whl
Size 90.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
85779166b9435eac557275c576b1553837d28e2e86ed88cbfbd3da271cc78c7c
BLAKE2b-256 checksum
How to use checksums
350e37948c791c399b4dbd1662e315b27ddf1282e626624c816dba555dae31b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

0.5.0

2 release files

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page