import json data = json.load(open('BACKEND/quran.json', encoding='utf-8')) lines = [ '// =============================================================', '// SAHIH ISLAM - STATIC QURAN SURAH METADATA (114 SURAHS)', '// =============================================================', '// Provides instantaneous 0ms loading for Quran index screen.', '// =============================================================', '', 'const List> kAllSurahsStaticData = [', ] for s in data: s_no = s['surah_no'] name_ar = s['name_arabic'].replace('"', '\\"') name_en = s['name_english'].replace('"', '\\"') trans_en = s['translation_english'].replace('"', '\\"') total = s['total_ayahs'] rev = s.get('revelation_type', '').replace('"', '\\"') lines.append(f' {{"surah_no": {s_no}, "name_arabic": "{name_ar}", "name_english": "{name_en}", "translation_english": "{trans_en}", "total_ayahs": {total}, "revelation_type": "{rev}"}},') lines.append('];') lines.append('') with open('FRONTEND/lib/models/surah_data.dart', 'w', encoding='utf-8') as f: f.write('\n'.join(lines)) print('FRONTEND/lib/models/surah_data.dart written successfully!')