RQD is a Python-based toolkit for comparing health insurance plans. It lets you:
- Define health plans with premiums, deductibles, copays, coinsurance, and out-of-pocket maximums.
- Estimate yearly spending for a usage profile that includes routine visits, specialist visits, emergency care, prescriptions, and additional costs.
- Compare multiple plans side by side with transparent cost breakdowns.
- Parse a simplified Summary of Benefits (SOB) text file into a structured plan definition.
- Drive the analysis from a command line interface that accepts JSON plan definitions or SOB text files.
RQD is packaged as a standard Python project. From the repository root, install it in editable mode with the development dependencies:
pip install -e .[dev]The rqd module ships with a command line interface.
Estimate the yearly cost for a plan:
python -m rqd.cli estimate plan.json usage.jsonCompare several plans:
python -m rqd.cli compare plan_a.json plan_b.json --usage usage.jsonParse a Summary of Benefits file and immediately evaluate the plan:
python -m rqd.cli from-sob sob.txt --usage usage.jsonSee python -m rqd.cli --help for the full list of commands and options.
from rqd.health_plan import HealthPlan
from rqd.comparator import compare_plans
plan = HealthPlan(name="ChoicePlus", monthly_premium=450, deductible=1500,
coinsurance=0.2, out_of_pocket_max=6000,
copays={"primary": 30, "specialist": 60, "emergency": 250},
prescription_costs={"generic": 10, "brand": 40})
usage = {
"primary_visits": 6,
"specialist_visits": 2,
"emergency_visits": 0,
"generic_prescriptions": 12,
"brand_prescriptions": 6,
"additional_expenses": 800
}
summary = plan.estimate_yearly_cost(usage)
comparison = compare_plans([plan], usage)Both functions return structured dictionaries suitable for further analysis or reporting.
Run the automated tests with pytest:
pytest