confpickem - NFL Confidence Pick'em AnalyzerA 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
Command Line Interface (Recommended)
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-climbfor 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
- Usage Walkthrough - A full week end to end, from the command line
- Python API Demo - The same flow from Python
- Optimization Methodology - How the optimizer works and why
- CLI Tools Guide - Full flag reference for the command-line tools
- CLI Tools (in package) - Detailed CLI documentation
- GitHub Repository - Source code and issues
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.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| confpickem-0.5.0.tar.gz | 693.7 kB | Without provenance | Details for confpickem-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| confpickem-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for confpickem-0.5.0-py3-none-any.whl |
Total release size: 789.3 kB
Release files / confpickem-0.5.0.tar.gz
| Download URL | confpickem-0.5.0.tar.gz |
|---|---|
| Size | 693.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
53dea491df9dfe9bdf37d66e5caf7ecbddc3bb6add3e30955b423c2a86026838
|
|
BLAKE2b-256 checksum How to use checksums |
c329c52c3dd6b57a35d685088e3372f93f40b8ecff216e1dbc197a1b15e82a7e
|
| 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.5.0-py3-none-any.whl
| Download URL | confpickem-0.5.0-py3-none-any.whl |
|---|---|
| Size | 95.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9937b715380e658fa50055f99c48ff073f04a2b54b627cba66891fb13a1e368c
|
|
BLAKE2b-256 checksum How to use checksums |
c7df75d774c804c285b3e4486a7e4acd95dd69add0cd5c184091d9c9859a146e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for confpickem 0.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.