sanatan_ai / modules /scripture_helpers /bhagavat_gita_helper.py
vikramvasudevan's picture
Upload folder using huggingface_hub
90a01cc verified
raw
history blame contribute delete
600 Bytes
import json
def get_chapter_order_from_bhagavat_gita():
chapters = []
with open("./data/bhagavat_gita_chapters.json", "r", encoding="utf-8") as f:
chapters = json.load(f)
return {chapter["chapter_title"]: chapter["chapter_number"] for chapter in chapters}
def get_bhagavat_gita_chapters() -> list[str]:
"""
Get a list of chapter names from bhagavat_gita
"""
chapters = []
with open("./data/bhagavat_gita_chapters.json", "r", encoding="utf-8") as f:
chapters = json.load(f)
return sorted(set([chapter["chapter_title"] for chapter in chapters]))