Skip to content
/ gita Public

gita-py is a lightweight Python package for programmatically accessing Bhagavad Gita chapter summaries and verses, letting developers fetch and validate spiritual content with simple functions.

License

Notifications You must be signed in to change notification settings

avarshvir/gita

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📖 gita

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.


🌟 Features

  • 📚 Get summary of a chapter
  • 🔍 Fetch a specific verse
  • 📖 Get all verses in a chapter
  • ✅ Validate chapters and verses
  • 🏷️ Retrieve chapter titles

📦 Installation

Clone this repository and install locally using:

git clone https://github.com/avarshvir/gita.git
cd gita

🧠 Usage

  1. 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
)
  1. Get Chapter Summary
print(get_summary(1))

  1. Get a Specific Verse
print(get_verse(1, 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}")
  1. List Available Summaries
print(list_available_summaries())
# Output: [1, 2, 3, 4]
  1. Validate Chapter or Verse
print(is_valid_chapter(1))  # True
print(is_valid_verse(1, 1))  # True or False
  1. Get Chapter Title
print(get_chapter_title(1))
# Output: Arjuna Vishada Yoga - The Yoga of Arjuna's Dejection

🧪 Running Tests

To run the unit tests, from the project root:

python -m unittest discover tests

💡 Applications in ML/AI

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.

📁 Project Structure

gita/
│
├── gita/
│   ├── __init__.py
│   ├── utils.py
│   ├── data.py
│   └── constant.py
│
├── tests/
│   └── test_gita.py
│
├── setup.py
├── README.md
├── pyproject.toml
└── MANIFEST.in

📜 License

This project is licensed under the MIT License.

🙏 Acknowledgements

  • Inspired by the sacred Bhagavad Gita
  • Developed with ❤️ by Arshvir

🚀 Future Plans

  • 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

About

gita-py is a lightweight Python package for programmatically accessing Bhagavad Gita chapter summaries and verses, letting developers fetch and validate spiritual content with simple functions.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages