import json from pathlib import Path ROOT = Path(__file__).resolve().parent operators = ["PARP", "FENG", "BGK", "NCBR", "NCN"] regions = ["mazowieckie", "wielkopolskie", "cała polska", "dolnośląskie"] statuses = ["otwarty", "otwarty", "otwarty", "otwarty", "zamknięty", "planowany"] topics = [ "OZE fotowoltaika dla MŚP", "fundusze europejskie innowacje", "cyfryzacja i AI", "B+R badania przemysłowe", "pożyczka na rozwój", ] grants = [] for i in range(200): op = operators[i % len(operators)] status = statuses[i % len(statuses)] region = regions[i % len(regions)] topic = topics[i % len(topics)] grants.append( { "id": f"sample-grant-{i:03d}", "nazwa": f"{topic} — program {i:03d} ({op})", "operator": op, "zrodlo": f"{op} — Nabory" if op in ("PARP", "NCBR", "NCN") else op, "beneficjenci": "Mikro, małe i średnie przedsiębiorstwa", "warunki_wejscia": "PKD 62.01.Z", "kwota_max": f"{(i + 1) * 10000} zł", "link_strona": f"https://example.com/grant/{i}", "status": status, "poziom_weryfikacji": "operator", "opis": f"{topic}. Wsparcie MŚP nr {i} w regionie {region}.", "region": region, } ) out = ROOT / "dotacje-latest.json" out.write_text(json.dumps(grants, ensure_ascii=False, indent=2), encoding="utf-8") print(f"Wrote {len(grants)} grants to {out}")