Add all local circuit work — year-by-year SVGs and tooling

This commit is contained in:
2026-03-25 22:17:47 +01:00
parent 6ceeba7fb9
commit c94ebcfb22
1149 changed files with 171650 additions and 421 deletions
+18
View File
@@ -0,0 +1,18 @@
import json
from pathlib import Path
from models.country import Country
def load_circuits_json(file_path: Path, load_geo_data: bool=False) -> dict[str, Country]:
with open(file_path) as f:
return parse_circuits_json(json.load(f), load_geo_data)
def parse_circuits_json(data: dict, load_geo_data: bool=False) -> dict[str, Country]:
countries = {}
for country_slug, country_data in data.items():
countries[country_slug] = Country.from_dict(country_slug, country_data)
if load_geo_data:
countries[country_slug].load_geo_json_data()
return countries