37 lines
1.2 KiB
Python
37 lines
1.2 KiB
Python
|
|
"""Cost-of-living module — feeds the simulator with real per-city spend ratios.
|
||
|
|
|
||
|
|
The simulator's `spending_gbp` is denominated in the user's BASELINE city
|
||
|
|
(typically London). When a scenario moves the user to a different TARGET
|
||
|
|
city, this module returns the ratio `target_total / baseline_total` so
|
||
|
|
the simulator can scale `spending_gbp` to local prices before running
|
||
|
|
paths.
|
||
|
|
|
||
|
|
Phase 1 (current): hand-curated baselines from Numbeo public pages, with
|
||
|
|
source URLs and fetch dates embedded so future-us can refresh by hand.
|
||
|
|
Phase 2 (planned): live scrapers for Numbeo + Expatistan, DB cache with
|
||
|
|
30-day TTL, nightly refresh CronJob.
|
||
|
|
"""
|
||
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
from fire_planner.col.models import CategoryBreakdown, CityCostIndex, ColSource
|
||
|
|
from fire_planner.col.service import (
|
||
|
|
JURISDICTION_REPRESENTATIVE_CITY,
|
||
|
|
compute_col_ratio,
|
||
|
|
lookup_city,
|
||
|
|
lookup_city_cached,
|
||
|
|
reconcile_sources,
|
||
|
|
representative_city_for,
|
||
|
|
)
|
||
|
|
|
||
|
|
__all__ = [
|
||
|
|
"CategoryBreakdown",
|
||
|
|
"CityCostIndex",
|
||
|
|
"ColSource",
|
||
|
|
"JURISDICTION_REPRESENTATIVE_CITY",
|
||
|
|
"compute_col_ratio",
|
||
|
|
"lookup_city",
|
||
|
|
"lookup_city_cached",
|
||
|
|
"reconcile_sources",
|
||
|
|
"representative_city_for",
|
||
|
|
]
|