Bottoms-up market sizing in Python. Model TAM, SAM, and SOM from real data instead of pulling numbers from analyst reports.
Every product strategy deck has a market sizing slide. Most of them are top-down guesses pulled from Gartner or Statista. This tool forces bottoms-up rigor: start with units, multiply by price, layer in assumptions, and stress-test them.
I built this because I got tired of seeing "$50B TAM" slides with no math behind them.
from market_sizer import MarketModel
model = MarketModel("US Telehealth — Behavioral Health")
# Define the funnel
model.set_population(
total_addressable=330_000_000, # US population
filters=[
("Adults 18+", 0.78),
("Has mental health need (per NIMH)", 0.227),
("Has insurance or ability to pay", 0.87),
("Willing to use telehealth", 0.64),
]
)
# Revenue assumptions
model.set_revenue(
avg_sessions_per_year=12,
avg_revenue_per_session=150,
)
# Run
model.calculate()
model.summary()Output:
┌─────────────────────────────────────────────────────┐
│ US Telehealth — Behavioral Health │
├─────────────────────────────────────────────────────┤
│ TAM $11.38B 330.0M × 22.7% × $150 × 12 │
│ SAM $6.36B TAM × 87.0% insured × 64.0% willing │
│ SOM $63.6M SAM × 1.0% capture rate │
├─────────────────────────────────────────────────────┤
│ Sensitivity: ±18% at 90% CI │
└─────────────────────────────────────────────────────┘
- Bottoms-up modeling — Start with population, apply filters, multiply by revenue
- Sensitivity analysis — Monte Carlo simulation on every assumption
- Scenario comparison — Model bull/base/bear cases side by side
- Export — Markdown tables, JSON, or CSV for your deck
pip install -r requirements.txt# Interactive mode
python market_sizer.py
# From a config file
python market_sizer.py --config examples/telehealth.yaml
# Compare scenarios
python market_sizer.py --config examples/telehealth.yaml --scenarios bull,base,bearfrom market_sizer import MarketModel, Scenario
base = Scenario("Base", capture_rate=0.01)
bull = Scenario("Bull", capture_rate=0.03)
bear = Scenario("Bear", capture_rate=0.005)
model = MarketModel("My Market")
# ... configure ...
model.compare([base, bull, bear])market-sizing-engine/
├── market_sizer.py # Core engine
├── models/
│ ├── __init__.py
│ ├── population.py # Population funnel modeling
│ ├── revenue.py # Revenue calculation
│ └── sensitivity.py # Monte Carlo sensitivity analysis
├── examples/
│ └── telehealth.yaml # Example config
├── tests/
│ └── test_market_sizer.py
├── requirements.txt
└── README.md
TAM = Total addressable population × Revenue per unit per year
SAM = TAM × Serviceable filters (geography, willingness, access)
SOM = SAM × Realistic capture rate
Sensitivity = Monte Carlo simulation (10,000 runs) varying each assumption ±20% with uniform distribution. Reports 90% confidence interval.
MIT