1e51ef7def
- Konzept/, didaktik_geografie/, didaktik_simulation/, v2-modules/, v2-platform/ - 12 code-workspace-Files - STATUS-*.md - viele M/D/R-Änderungen an bereits getrackten Files - .gitignore verstärkt: **/.humaninput/, **/secret_keys.txt Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
37 lines
1.4 KiB
Python
37 lines
1.4 KiB
Python
#!/usr/bin/env python3
|
|
"""Mergt die 4 Tranche-JSON-Files zu einer einzigen dishes.json mit allen 30 Gerichten.
|
|
Behält das ursprüngliche dishes.json als dishes-tranche-a.json als Backup."""
|
|
import json
|
|
import shutil
|
|
from pathlib import Path
|
|
|
|
DATA = Path('C:/xampp/htdocs/geograsim/App/sims/weltkueche/assets/data')
|
|
|
|
# Tranche A → kopieren in dishes-tranche-a.json (Backup)
|
|
shutil.copy(DATA / 'dishes.json', DATA / 'dishes-tranche-a.json')
|
|
|
|
merged = {
|
|
'_meta': {
|
|
'description': 'Weltküche — alle 30 Gerichte gemergt aus 4 Tranchen.',
|
|
'count': 30,
|
|
'tranchen': {'A': 'AT-regional (5)', 'B': 'DACH (10)', 'C': 'Europa (10)', 'D': 'Exotisch (5)'},
|
|
'stand': '2026-06-07'
|
|
}
|
|
}
|
|
|
|
for fn in ['dishes-tranche-a.json', 'dishes-tranche-b.json', 'dishes-tranche-c.json', 'dishes-tranche-d.json']:
|
|
path = DATA / fn
|
|
data = json.loads(path.read_text(encoding='utf-8'))
|
|
for key, val in data.items():
|
|
if key.startswith('_'):
|
|
continue
|
|
# id-Feld zur Sicherheit ergänzen
|
|
val['id'] = key
|
|
merged[key] = val
|
|
print(f'{fn}: {len([k for k in data if not k.startswith("_")])} Gerichte')
|
|
|
|
# Final ausschreiben
|
|
out_path = DATA / 'dishes.json'
|
|
out_path.write_text(json.dumps(merged, indent=2, ensure_ascii=False), encoding='utf-8')
|
|
print(f'\n→ {out_path.name}: {len([k for k in merged if not k.startswith("_")])} Gerichte total')
|