gita is a lightweight Python package providing access to summaries and verses from the Bhagavad Gita. It allows you to retrieve summaries, verses, chapter titles, and validate content programmatically.
- 📚 Get summary of a chapter
- 🔍 Fetch a specific verse
- 📖 Get all verses in a chapter
- ✅ Validate chapters and verses
- 🏷️ Retrieve chapter titles
Clone this repository and install locally using:
git clone https://github.com/avarshvir/gita.git
cd gita- Import the functions
from gita.utils import (
get_summary,
get_verse,
get_all_verses,
list_available_summaries,
is_valid_chapter,
is_valid_verse,
get_chapter_title
)
- Get Chapter Summary
print(get_summary(1))
- Get a Specific Verse
print(get_verse(1, 1.1))
- Get All Verses from a Chapter
verses = get_all_verses(1)
for verse_number, verse_text in verses.items():
print(f"{verse_number}: {verse_text}")
- List Available Summaries
print(list_available_summaries())
# Output: [1, 2, 3, 4]
- Validate Chapter or Verse
print(is_valid_chapter(1)) # True
print(is_valid_verse(1, 1)) # True or False
- Get Chapter Title
print(get_chapter_title(1))
# Output: Arjuna Vishada Yoga - The Yoga of Arjuna's Dejection
To run the unit tests, from the project root:
python -m unittest discover tests
The gita package can also serve as a semantic, philosophical, or ethical dataset for NLP and AI applications, including:
- 🧘♂️ **Spiritual NLP:** Use summaries/verses for language modeling, text classification, or chatbot responses in spiritual/ethical domains.
- 📊 **Topic Modeling:** Apply unsupervised learning (like LDA) to explore themes across chapters and verses.
- 🤖 **Conversational AI:** Integrate with chatbots or voice assistants to answer questions from the Gita.
- 🧠 **Fine-Tuning LLMs:** Fine-tune transformer models on Bhagavad Gita content for custom applications like question answering, summarization, or translation.
- 🧘 **Emotion Detection:** Train sentiment analysis models on Gita texts for understanding philosophical tone and emotion.
- 📚 **Text Embeddings:** Generate vector embeddings for each verse/summary to use in semantic search or recommender systems.
With a structured dataset and utilities, gita can be a powerful component in building ethically aware and spiritually aligned AI systems.
gita/
│
├── gita/
│ ├── __init__.py
│ ├── utils.py
│ ├── data.py
│ └── constant.py
│
├── tests/
│ └── test_gita.py
│
├── setup.py
├── README.md
├── pyproject.toml
└── MANIFEST.in
This project is licensed under the MIT License.
- Inspired by the sacred Bhagavad Gita
- Developed with ❤️ by Arshvir
- Add all 18 chapter summaries
- Include all verses from all chapters
- Add audio and image support
- Build a Streamlit/Flask interface
- Extend NLP/ML capabilities for philosophical Q&A