import json
from pathlib import Path
raw={'registrations':[1000,1200],'paid_users':[100,108],'revenue':[10000,11880],'refunds':[500,900]}
growth={k:(v[1]/v[0]-1)*100 for k,v in raw.items()};assert abs(growth['revenue']-18.8)<1e-9 and abs(growth['refunds']-80)<1e-9
Path('kpi-calculation.json').write_text(json.dumps(growth,indent=2))
print('Registrations20%; paid8%; revenue18.8%; refunds80%. Numeric change does not prove cause.')
