Select a category to manage your library.
Format: Start each chapter with its title on its own line (no pipe symbol).
Then add verses below it, one per line: number | English text | Gujarati text
Leave a blank line between chapters. English column is optional — leave blank if Gujarati only: 1 | | Gujarati text
Chapter title on its own line, then verses: number | English | Gujarati. Blank line between chapters.
These chapters are appended after existing ones.
Upload your otntchapters.csv file. Select a specific book to import titles for that book only, or leave blank to import all books at once.
CSV columns: book_id, book_en, book_gu, chapter_num, title_en, title_gu
Python scripts for maintenance, data repair, and one-time operations.
All scripts go in your sacred-library-v3 folder and are run from the terminal.
python generate_ai_word_study.py --file nt --lang en
python generate_ai_word_study.py --file ot --lang en
python -c "import json; d=json.load(open('data/word_study_nt.json',encoding='utf-8')); done=sum(1 for v in d.values() if v.get('ai_en','')); print(f'NT Done: {done}/{len(d)} ({round(done/len(d)*100,1)}%)')"
python -c "import json; d=json.load(open('data/word_study_ot.json',encoding='utf-8')); done=sum(1 for v in d.values() if v.get('ai_en','')); print(f'OT Done: {done}/{len(d)} ({round(done/len(d)*100,1)}%)')"
python translate_ai_fields.py --file nt
python translate_ai_fields.py --file ot
python translate_ai_fields.py --file both
python -c "import json; ch=json.load(open('data_reference/the_antiquities_of_the_jews_chapters.json',encoding='utf-8')); total=sum(len(c.get('verses',[])) for c in ch); done=sum(1 for c in ch for v in c.get('verses',[]) if v.get('gu','').strip()); print(f'Josephus: {done}/{total} ({round(done/total*100)}%)')"
GROQ_KEYS = ['gsk_key1', 'gsk_key2', 'gsk_key3'] # in server.py
python translate_book.py --book the_antiquities_of_the_jews
python translate_book.py --book mishnah_berakhot
python translate_book.py --book pirkei_avot
python fix_vocabulary.py --all
python translate_book.py --book matthew_henry_gen
― Repeat for each book: matthew_henry_exo, matthew_henry_mat, etc.
python backup.py
python check_corrupted.py
python cleanup_books.py
cleanup_books.py
DATA REPAIR
Removes reference library books from data/books.json to fix the "Other" tile on the dashboard. Safe to run anytime — backs up data/books.json first.
python cleanup_books.py
backup.py
BACKUP
Creates a full ZIP of the entire sacred-library-v3 project (code + data) with a timestamp. Keeps last 10 backups automatically.
python backup.py --dest "D:\Backups"
import_kjva.py
RESTORE
Restores Apocrypha chapter files from KJVA.json. Use when a chapter file gets corrupted or emptied. Requires KJVA.json in the project folder.
python import_kjva.py --book belandthedragon
python import_kjva.py --all-apocrypha
merge_english_ot.py
DATA REPAIR
Adds English verses (en field) to all OT and NT chapter files from KJVA.json. Required for English search to work. Run once after initial setup. Skips verses that already have English.
python merge_english_ot.py --kjva "C:\path o\KJVA.json"
translate_book.py
TRANSLATION
Translates English verses to Gujarati using Google Translate (deep-translator). Use for Apocrypha books. Auto-resumes if interrupted. Also available from Admin → Translate tab.
python translate_book.py --book tobit
python translate_book.py --book tobit --preview
generate_word_study_nt.py
WORD STUDY
Generates Gujarati meanings for all 5,523 Greek Strong's entries using Google Translate. Writes to data/word_study_nt.json. Use --merge to preserve manual edits. Takes ~45 minutes.
python generate_word_study_nt.py --merge
python generate_word_study_nt.py --start G500
migrate_ai_fields.py
MIGRATION
Moves legacy ai field to ai_gu in word study files. Run once if you have old AI responses that weren't saved to the language-specific fields (ai_gu / ai_en).
python migrate_ai_fields.py
recover_chapters.py
RECOVERY
Restores empty or corrupted chapter files from a JSON backup. Use when a chapter file gets emptied by a failed save operation.
python recover_chapters.py --backup sacred-library-backup-2026-05-19.json --book belandthedragon
python recover_chapters.py --backup backup.json --all
set_skip_cover.py
SETUP
Sets skipCover:true on all 66 OT/NT books so they open directly to the chapter grid instead of the cover page. Run once after initial setup.
python set_skip_cover.py
generate_ai_word_study.py
WORD STUDY
Uses Groq AI (free) to generate English (ai_en) explanations for all Hebrew and Greek Strong's entries. Add Groq keys to server.py as GROQ_KEYS list — each key adds ~100 entries/day. Rotates keys automatically and resumes where it left off. After ai_en is complete, run translate_ai_fields.py to convert to Gujarati (ai_gu) via deep-translator.
GROQ_KEYS = ['gsk_key1', 'gsk_key2', ...]python generate_ai_word_study.py --file nt --lang en
python generate_ai_word_study.py --file ot --lang en
python translate_ai_fields.py --file both
fix_missing_definitions.py
DATA REPAIR
Manually adds English definitions to the 20 NT Greek Strong's entries that were skipped by generate_word_study_nt.py (particles, pronouns, proper nouns with no definition in the source). Run once, then run generate_word_study_nt.py --merge to translate to Gujarati.
python fix_missing_definitions.py
fix_vocabulary.py
VOCABULARY
Re-applies all word replacements from christian_vocab.json to every translated book. Also available via Admin → Vocabulary Manager → Fix All Books button. Run from terminal if the admin button times out on large libraries.
python fix_vocabulary.py
python fix_vocabulary.py --book tobit
import_sefaria.py
REFERENCE LIBRARY
Imports any text from Sefaria.org into the Reference Library (data_reference/). Handles Talmud, Mishnah, Midrash, Josephus. Detects chapter/verse structure automatically. Also available via Admin → Reference Library → Sefaria Importer.
python import_sefaria.py --ref "Mishnah Berakhot" --id mishnah_berakhot --title "Mishnah Berakhot" --section mishnah
python import_sefaria.py --ref "The Antiquities of the Jews" --id josephus_antiquities --section josephus --dry-run
check_corrupted.py
DATA REPAIR
Scans all chapter files for corruption — empty verses, missing Gujarati text, malformed JSON. Outputs a report of any issues found. Run periodically or after any bulk operation.
python check_corrupted.py
python check_corrupted.py --book genesis
translate_ai_fields.py
WORD STUDY
Translates ai_en → ai_gu using Google Translate (deep-translator). Run after AI finishes generating ai_en. No API limits — runs entirely locally. Keep this tab open while running.
python translate_ai_fields.py --file nt
python translate_ai_fields.py --file ot
python translate_ai_fields.py --file both
add_apocrypha.py
SETUP
Adds the Apocrypha section and books to books.json. Run once during initial library setup if Apocrypha section is missing.
python add_apocrypha.py
import_kjv.py / import_kjv_english.py
IMPORT
Downloads KJV Bible from GitHub and merges English verses into existing chapter files. Use for adding English text alongside Gujarati translations.
python import_kjv.py
python import_kjv_english.py
import_kjva_json.py / import_kjva_sqlite.py
IMPORT
Converts KJVA Bible from JSON or SQLite format into Sacred Library chapter format. KJVA includes the Apocrypha books.
python import_kjva_json.py --input KJVA.json
python import_kjva_sqlite.py
patch_books.py
DATA REPAIR
Adds missing chapters_note field to OT and Apocrypha books in books.json. Run if book tiles show no chapter count.
python patch_books.py
save_word_study_fix.py
WORD STUDY
Fixes and saves word study JSON files. Use if word study data becomes corrupted or needs repair after a failed write operation.
python save_word_study_fix.py
translate_matthew_henry.py
COMMENTARY
Translates all 64 Matthew Henry commentary books to Gujarati using deep-translator. Skips already-translated books. Run after import_matthew_henry.py --all. Takes about 15-20 minutes for all books.
python translate_matthew_henry.py
python translate_matthew_henry.py --testament OT
python translate_matthew_henry.py --testament NT
python translate_matthew_henry.py --overwrite
import_matthew_henry.py
COMMENTARY
Imports Matthew Henry's Bible Commentary (1706, public domain) from the HelloAO Free Bible API. Imports chapter-by-chapter commentary into the Reference Library. After import, run translate_book.py to translate to Gujarati.
python import_matthew_henry.py --book GEN
python import_matthew_henry.py --testament OT
python import_matthew_henry.py --testament NT
python import_matthew_henry.py --all
add_chapter_titles.py
CONTENT
Bulk imports chapter titles from a CSV file into chapter JSON files. CSV format: book_id, chapter_number, english_title, gujarati_title. Also available via Admin → Chapter Titles tab.
python add_chapter_titles.py --csv chapter_titles.csv
Manage replacement words used during translation. Stored in christian_vocab.json.
All translation scripts load from this file automatically.
After adding new words, run the fix script to update already-translated chapter files.
Search any book for a Gujarati word — see every verse it appears in, how many times, and all variations. Use this to find words that need vocabulary replacements.
Complete reference for how Sacred Scripture Library works, what files are needed, and where they live.
sacred-library-v3/
├── server.py ← Flask backend (run this)
│ GROQ_KEYS = [...] ← Add Groq API keys here
│ GEMINI_KEYS = [...] ← Legacy Gemini keys (unused)
│
├── backup.py ← Full project ZIP backup
├── cleanup_books.py ← Remove reference books from main library
├── import_kjva.py ← Restore Apocrypha from KJVA.json
├── import_sefaria.py ← Import texts from Sefaria.org
├── translate_book.py ← Translate book to Gujarati (chunked)
├── translate_ai_fields.py ← Translate ai_en → ai_gu via deep-translator
├── generate_word_study_nt.py ← Generate NT word study from Strongs
├── generate_ai_word_study.py ← Generate ai_en via AI (daily)
├── fix_vocabulary.py ← Re-apply christian_vocab.json to books
├── fix_missing_definitions.py ← Add EN definitions to 20 skipped NT entries
├── check_corrupted.py ← Scan chapter files for corruption
├── recover_chapters.py ← Recover corrupted chapter files
├── migrate_ai_fields.py ← Migrate legacy ai field to ai_gu
├── KJVA.json ← Source for all Apocrypha books
│
├── data_reference/ ← Reference Library (separate from Bible)
│ ├── books.json ← Reference books list
│ ├── sections.json ← Reference sections (Talmud, Mishnah, etc.)
│ └── {book}_chapters.json ← Reference book chapter files
│
├── index.html ← Main dashboard
├── book.html ← Book reader + interlinear
├── admin.html ← Admin panel
├── help.html ← Reader's guide
├── word_browser.html ← Word study browser (opens from admin)
├── video_script.html ← Video presentation script
├── style.css ← All styles
│
├── data/
│ ├── books.json ← Library index (all 83 books)
│ ├── sections.json ← Library definitions (OT/NT/Apocrypha)
│ ├── word_study_ot.json ← Hebrew word study (H1–H8674)
│ ├── word_study_nt.json ← Greek word study (G1–G5624)
│ ├── strongs_greek.json ← Greek Strong's lexicon (5523 entries)
│ ├── strongs_hebrew.json ← Hebrew Strong's lexicon
│ ├── tantt_nt.json ← NT Greek interlinear data
│ ├── tantt_{book}.json ← OT Hebrew interlinear (per book)
│ ├── hmorph.json ← Hebrew morphology data
│ ├── activity_log.json ← Reader activity tracking
│ ├── genesis_chapters.json ← OT chapters (en + gu fields)
│ ├── exodus_chapters.json ← (same pattern for all OT books)
│ ├── john_chapters.json ← NT chapters (en + gu fields)
│ ├── genesis_history.json ← Book history + foreword
│ └── english/
│ ├── tobit_chapters.json ← Apocrypha (en + gu)
│ ├── belandthedragon_chapters.json
│ └── (all other Apocrypha books)
│
└── scripts/
└── bg.js ← Background animation
{
"id": "genesis", // Unique book ID (lowercase, no spaces)
"title": "Genesis", // English title
"titleGu": "ઉત્પત્તિ", // Gujarati title
"sacred_label": "🕊 · GENESIS · ΑΩ",
"section": "old_testament", // old_testament | new_testament | apocrypha
"data_chapters": "data/genesis_chapters.json",
"data_history": "data/genesis_history.json",
"hasGujarati": true, // false = gray out language toggle
"skipCover": true, // true = skip cover, go to chapter grid
"chapters_note": "50 Chapters"
}
[
{
"title": "Chapter 1 — The Creation",
"titleGu": "પ્રકરણ ૧ — સૃષ્ટિ",
"verses": [
{ "num": 1, "en": "In the beginning...", "gu": "આદિમાં..." }
]
}
]
{
"G3056": {
"w": "λόγος", // Greek/Hebrew word
"t": "logos", // Transliteration
"pron": "LOH-gos", // Pronunciation
"en": "Word, reason", // English meaning
"gu": "વચન", // Gujarati meaning
"arth": "ઈશ્વરનો...", // Gujarati arth (extended meaning)
"example": "John 1:1", // Usage example
"note": "...", // Theological note
"ai_gu": "...", // AI explanation in Gujarati
"ai_en": "...", // AI explanation in English
}
}
{
"foreword": "Personal note about this translation...",
"sections": [
{ "title": "Historical Background", "body": "..." },
{ "title": "Authorship & Date", "body": "..." },
{ "title": "Theological Significance", "body": "..." }
]
}
| Endpoint | Description |
|---|---|
| GET /data/* | Serve all data files |
| POST /api/login | Admin authentication |
| POST /api/gemini | AI proxy (word study + history) |
| GET/POST /api/word-study | Read/save word study entries |
| POST /api/write/* | Write any data file |
| POST /api/track | Log reader activity |
| POST /api/translate-book | Translate book via deep-translator (SSE) |
| GET /api/ping | Server health check |
server.py — keep this file privateManage all books in the library. For each book you can:
set_skip_cover.py to do this in one shot.
Add new chapters to an existing book by pasting formatted text. Format:
Chapter 1: Title Here 1 | English verse | ગુજરાતી વાક્ય 2 | English verse | ગુજરાતી વાક્ય
Chapters are appended after existing ones.
Select a book and chapter to edit individual verse content, chapter title, and Gujarati title. Changes are saved immediately to the server.
Import chapter titles from a CSV file. CSV format:
book_id,book_en,book_gu,chapter_num,title_en,title_gu genesis,Genesis,ઉત્પત્તિ,1,The Creation,વિશ્વની ઉત્પત્તિ
Manage library sections (Old Testament, New Testament, Apocryphal). You can:
Manage Hebrew and Greek word study definitions.
word_study_nt.jsonword_study_ot.jsonstrongs, greek, transliteration, pronunciation, definition, gujarati bhashanter, gujarati arth, nt usage exampleImport Gujarati Bible text from the godlytalias API directly into any book. Select a book, choose the Bible book to fetch, and import chapter by chapter or all at once.
merge_english_ot.py — run once to add English verses to OT/NT files (required for English search)import_kjva.py — restore any Apocrypha book from KJVA.json if corruptedtranslate_book.py — terminal alternative to Translate tab with Christian vocab replacementsTimelines, maps, and visual pages (e.g. timeline_church.html, timeline_tabernacle_3d.html) are added as reference library book entries with an External URL pointing to the HTML file. They appear automatically on the dashboard under the Timelines tile.
index.html, book.html etc.)| Field | What to enter | Example |
|---|---|---|
| Book ID | Unique, lowercase, no spaces | timeline_church |
| Title | English title shown on tile | Spread of the Early Church |
| Title Gujarati | Gujarati title shown in ગુ mode | પ્રારંભિક ચર્ચનો ફેલાવો |
| Section | Must be timelines | timelines |
| External URL | Path to the HTML file | /timeline_church.html |
| Status | Published | Published |
| Skip Cover Page | ✅ Always check this | ✅ checked |
| Icon / Emoji | Shown on the tile | ✝ or 🏕 |
section field must exactly match the section ID in data_reference/sections.json — for timelines this is timelines. If you're unsure, open an existing timeline in Edit Books and check its Section value.index.html. To update them, search for 'timelines': ['⌛','👑','📯','⚓'] in index.html and edit the array.
| File | Title | Book ID |
|---|---|---|
timeline_lifespans.html | Biblical Lifespans | timeline_lifespans |
timeline_jesse.html | Jesse Tree — Lineage of Christ | timeline_jesse |
timeline_kings.html | Kings of Israel & Judah | timeline_kings |
timeline_prophets.html | The Prophets | timeline_prophets |
timeline_paul.html | Paul's Missionary Journeys | timeline_paul |
timeline_exodus.html | The Exodus Route | timeline_exodus |
timeline_tabernacle.html | The Tabernacle | timeline_tabernacle |
prophecy_timeline.html | Prophecy Timeline | prophecy_timeline |
timeline_church.html 🆕 | Spread of the Early Church | timeline_church |
timeline_tabernacle_3d.html 🆕 | The Tabernacle — 3D Cutaway | timeline_tabernacle_3d |
Full architecture of Sacred Library — from server startup through data, scripts, API, admin, and reader layers.
Step-by-step journey of a reader — from opening the app to reading, studying, and bookmarking.
Find a Gujarati word across all NT or OT word study entries and replace it. Applies to the gu (definition) and ai_gu (AI explanation) fields.
Use AI to generate rich explanations for Hebrew and Greek Strong's entries. Saves progress automatically — safe to stop and resume.
| STRONG'S | WORD | TRANSLIT | GUJARATI | ARTH | ENGLISH | NOTE | AI GU | AI EN | ACTION |
|---|
Sections group books on the dashboard. Drag to reorder. Books can be assigned to sections in the Edit / Manage tab.
Reorder the Reference Library sections (Matthew Henry, Rashi, Timelines etc.)
Drag the books into the desired display order.
Edit the historical background and foreword for each book. Use AI to generate a draft, then edit as needed.
Ask AI to write a historical background, author info, theological significance, and foreword for the selected book. You can edit the result before saving.
Select a book, generate the terminal command, run it on your Mac, then preview the result here.
Full storyboard and narration script for creating a Sacred Library video using Canva (free).
video_script.html is in your sacred-library-v3 folder. Open it and use Print → Save as PDF to keep a copy.
Downloads a complete snapshot of all library data — books, chapters, word study (OT + NT), sections, and activity log — as a single JSON file.
If an Apocrypha chapter file gets corrupted or emptied, restore it from KJVA.json.
Place KJVA.json in your sacred-library-v3 folder first.
all-apocrypha to restore all at once.
Runs backup.py to ZIP the entire project — all code, data, and assets — and saves it to your chosen destination.
Copy backup.py to your sacred-library-v3 folder first.
python.exe · Arguments: C:\path\to\backup.py --dest YOUR_DEST
Fetch any NT book from the godlytalias public database (ERV Gujarati — uses શબ્દ and દેવ).
Upload a JSON file from your computer. Works for any structured text — Bible translations, dictionaries, commentaries, maps.
Fetch JSON from any URL — Bible APIs, dictionaries, maps, or any public JSON endpoint.
| Time | Reader | Book | Chapter | Action |
|---|
Sections set to Published will appear in the library. Keep unpublished until content is complete.
Fetch any text from Sefaria.org — Talmud, Mishnah, Midrash, Josephus. Free API, no key needed.
Test how text-to-speech sounds on this device before rolling out audio to readers. Open this page on your phone to test mobile voices.
In the beginning God created the heaven and the earth.
શરૂઆતમાં ઈશ્વરે સ્વર્ગ અને પૃથ્વીની સૃષ્ટિ કરી.
After testing, pick what to build:
This permanently removes the book from the library index. The chapter and history data files
will remain on GitHub but the book will no longer appear on the site.
This action requires your admin password to confirm.
Hides the book from the library but keeps all data. You can restore it anytime.
Cannot be undone. Removes the book from the library index permanently.