Skip to main content

Python SDK for WideGita — Bhagavad Gita verses, commentaries, Upanishads, Yoga Sutras, Hindu deities. 18 chapters, 6,308 verses across 9 translations, 2,103 commentary entries, 10 Upanishads, 196 Yoga Sutras.

Project description

widegita

PyPI Python License: MIT

Python SDK for WideGita — access the Bhagavad Gita's 18 chapters and 6,308 verses across 9 commentator translations, 2,103 commentary entries from classical Acharyas, 10 principal Upanishads, all 196 Yoga Sutras of Patanjali, Hindu deities, and a comprehensive Sanskrit glossary. Typed API client with CLI.

WideGita is part of the WideHoly multi-religion scripture platform, providing structured access to Hindu sacred texts. The REST API serves verse-level data with Sanskrit originals, transliterations, and multiple English translations from scholars including Swami Sivananda, Swami Gambhirananda, and Sri Ramanuja.

Explore the Bhagavad Gita at widegita.comChapters, Commentaries, Upanishads, Yoga Sutras, Deities

Table of Contents

Install

# API client only
pip install widegita[api]

# API client + CLI
pip install widegita[cli]

# Everything
pip install widegita[all]

Quick Start

from widegita import WideGita

with WideGita() as api:
    # Get chapter 2 — Sankhya Yoga (the Yoga of Knowledge)
    chapter = api.get_chapter(2)
    print(chapter["name"])         # "Sankhya Yoga"
    print(chapter["verse_count"])  # 72

    # Read the most famous verse: BG 2.47
    # "You have a right to perform your prescribed duty,
    #  but you are not entitled to the fruits of action."
    verse = api.get_verse(2, 47)
    print(verse["text_sanskrit"])
    print(verse["text"])

    # Search across all verses for references to dharma
    results = api.search("dharma")
    for v in results["results"][:5]:
        print(f"{v['reference']}: {v['text'][:80]}...")

    # Explore Yoga Sutra 1.2 — Patanjali's definition of yoga
    sutra = api.get_yoga_sutra("1-2")
    print(sutra["translation_text"])  # "Yoga is the cessation of the modifications of the mind"

What You'll Find on WideGita

Bhagavad Gita Chapters & Verses

The Bhagavad Gita consists of 18 chapters, each representing a different yoga (path of spiritual practice). Set on the battlefield of Kurukshetra, the dialogue between Lord Krishna and the warrior Arjuna addresses fundamental questions of duty, righteousness, devotion, and liberation.

Chapter Name Sanskrit Verses Theme
1 Arjuna's Dilemma Arjuna Vishada Yoga 47 The crisis of conscience on the battlefield
2 Sankhya Yoga Sankhya Yoga 72 The immortal Self, duty without attachment
3 Karma Yoga Karma Yoga 43 The path of selfless action
4 Jnana Yoga Jnana Karma Sannyasa Yoga 42 Divine knowledge and renunciation
5 Renunciation Karma Sannyasa Yoga 29 Action vs. renunciation
6 Dhyana Yoga Dhyana Yoga 47 Meditation and self-mastery
7 Jnana Vijnana Yoga Jnana Vijnana Yoga 30 Knowledge of the Absolute
8 Aksara Brahma Yoga Aksara Brahma Yoga 28 The imperishable Brahman
9 Raja Vidya Yoga Raja Vidya Raja Guhya Yoga 34 The royal knowledge and secret
10 Vibhuti Yoga Vibhuti Yoga 42 Divine manifestations
11 Vishvarupa Darshana Vishvarupa Darshana Yoga 55 The cosmic form of Krishna
12 Bhakti Yoga Bhakti Yoga 20 The path of devotion
13 Kshetra Kshetrajna Kshetra Kshetrajna Vibhaga Yoga 35 The field and the knower
14 Gunatraya Vibhaga Gunatraya Vibhaga Yoga 27 The three gunas (qualities)
15 Purushottama Yoga Purushottama Yoga 20 The Supreme Person
16 Daivasura Sampad Daivasura Sampad Vibhaga Yoga 24 Divine and demoniac natures
17 Shraddhatraya Shraddhatraya Vibhaga Yoga 28 Three types of faith
18 Moksha Sannyasa Moksha Sannyasa Yoga 78 Liberation through renunciation

WideGita provides 6,308 verses across 9 commentator translations, each verse with the original Sanskrit text, IAST transliteration, and English translation.

with WideGita() as api:
    # List all 18 chapters with verse counts and yoga names
    chapters = api.list_chapters()
    for ch in chapters["results"]:
        print(f"Ch {ch['number']}: {ch['yoga_name']}{ch['verse_count']} verses")

    # Get verse with Sanskrit original and transliteration
    verse = api.get_verse(2, 47, translation="sivananda")
    print(verse["text_sanskrit"])    # Original Devanagari
    print(verse["transliteration"])  # IAST romanization
    print(verse["text"])             # English translation

Learn more: Gita Chapters · Verse Browser

Commentary Traditions

The Bhagavad Gita has been interpreted by the greatest minds of Indian philosophy. WideGita includes 2,103 commentary entries from 9 classical commentators spanning the major Vedantic traditions.

Commentator Tradition Period Philosophy
Adi Shankaracharya Advaita Vedanta 8th century Non-dualism (Brahman alone is real)
Ramanujacharya Vishishtadvaita 11th century Qualified non-dualism
Madhvacharya Dvaita Vedanta 13th century Dualism (jiva and Brahman are distinct)
Swami Sivananda Neo-Vedanta 20th century Practical synthesis of yoga paths
Swami Gambhirananda Advaita Vedanta 20th century Scholarly Shankara tradition
Sri Abhinavagupta Kashmir Shaivism 10th century Tantric non-dualism
Vallabhacharya Shuddhadvaita 15th century Pure non-dualism (devotion-centric)
Sridhara Swami Advaita Vedanta 14th century Bridge between Advaita and Bhakti
Baladeva Vidyabhushana Gaudiya Vaishnavism 18th century Acintya Bheda Abheda
with WideGita() as api:
    # List commentaries from the Advaita tradition
    advaita = api.list_commentaries(tradition="advaita")
    for c in advaita["results"]:
        print(f"{c['author']}{c['name']}")

    # Get Shankaracharya's commentary entries for chapter 2
    entries = api.list_commentary_entries(commentary="shankaracharya", chapter=2)
    for e in entries["results"][:3]:
        print(f"Verses {e['verse_start']}-{e['verse_end']}: {e['text'][:100]}...")

Learn more: Commentary Traditions · Glossary of Terms

Upanishads

The Upanishads are the philosophical culmination of the Vedas, exploring the nature of Brahman (ultimate reality), Atman (the Self), and the path to liberation. WideGita covers the 10 principal (Mukhya) Upanishads acknowledged by Adi Shankaracharya, drawn from all four Vedas.

Upanishad Veda Key Teaching
Isha Yajur Veda The Lord pervades all; renunciation and enjoyment
Kena Sama Veda The unknowable nature of Brahman
Katha Yajur Veda Nachiketa's dialogue with Death; the immortal Self
Prashna Atharva Veda Six questions on the nature of creation and prana
Mundaka Atharva Veda Higher vs. lower knowledge; Brahman as the thread
Mandukya Atharva Veda AUM and the four states of consciousness
Taittiriya Yajur Veda Five sheaths (koshas) of the Self
Aitareya Rig Veda Creation from Atman; the nature of consciousness
Chandogya Sama Veda "Tat Tvam Asi" — Thou art That
Brihadaranyaka Yajur Veda The largest Upanishad; Yajnavalkya's teachings
with WideGita() as api:
    # List only principal Upanishads
    principal = api.list_upanishads(principal_only=True)
    for u in principal["results"]:
        print(f"{u['name']} ({u['sanskrit_name']}) — {u['veda']}")

    # Filter by Veda
    yajur = api.list_upanishads(veda="yajur")
    print(f"Yajur Veda Upanishads: {yajur['count']}")

    # Get details for Katha Upanishad
    katha = api.get_upanishad("katha")
    print(katha["description"])

Learn more: Upanishads · Hindu Concepts

Yoga Sutras of Patanjali

The Yoga Sutras are 196 concise aphorisms compiled by the sage Patanjali, forming the foundational text of Raja Yoga (the royal path of meditation). The text is divided into four padas (chapters), each addressing a different aspect of yogic practice.

Pada Name Sutras Focus
1 Samadhi Pada 51 The nature of yoga and states of absorption
2 Sadhana Pada 55 Practice: Kriya Yoga, the Eight Limbs (Ashtanga)
3 Vibhuti Pada 56 Supernatural powers (siddhis) arising from practice
4 Kaivalya Pada 34 Liberation — the isolation of pure consciousness

The Eight Limbs of Yoga (Ashtanga Yoga) outlined in Sadhana Pada form the practical framework: Yama (restraints), Niyama (observances), Asana (posture), Pranayama (breath control), Pratyahara (sense withdrawal), Dharana (concentration), Dhyana (meditation), and Samadhi (absorption).

with WideGita() as api:
    # List all sutras in Samadhi Pada (Chapter 1)
    pada_1 = api.list_yoga_sutras(pada=1)
    print(f"Samadhi Pada: {pada_1['count']} sutras")

    # Get the famous definition of yoga (Sutra 1.2)
    # "Yogas chitta vritti nirodhah" — Yoga is the cessation of
    # the modifications of the mind
    sutra_1_2 = api.get_yoga_sutra("1-2")
    print(sutra_1_2["text_sanskrit"])
    print(sutra_1_2["transliteration"])
    print(sutra_1_2["translation_text"])

Learn more: Yoga Sutras · Topics

Hindu Deities & Concepts

WideGita covers the major deities of the Hindu pantheon and core philosophical concepts that underpin the Gita's teachings. The deity database includes the Trimurti (Brahma, Vishnu, Shiva), their avatars, consorts, and associated traditions.

Trimurti — The Three Supreme Forms:

Deity Role Tradition Key Avatars
Brahma Creator
Vishnu Preserver Vaishnavism Krishna, Rama, Narasimha, Vamana
Shiva Destroyer/Transformer Shaivism Nataraja, Rudra, Dakshinamurthy

Core Philosophical Concepts:

Concept Sanskrit Meaning
Dharma Dharma Cosmic order, righteousness, duty
Karma Karma Action and its consequences across lifetimes
Moksha Moksha Liberation from the cycle of birth and death
Atman Atman The eternal Self, identical with Brahman
Brahman Brahman The ultimate, formless reality
Maya Maya The illusory nature of the phenomenal world
Samsara Samsara The cycle of birth, death, and rebirth
Bhakti Bhakti Selfless devotion to God
Jnana Jnana Spiritual knowledge, wisdom
Yoga Yoga Union; the discipline of spiritual practice
with WideGita() as api:
    # List Trimurti deities
    trimurti = api.list_deities(trimurti_only=True)
    for d in trimurti["results"]:
        print(f"{d['name']} ({d['sanskrit_name']})")

    # List deities by tradition
    vaishnava = api.list_deities(tradition="vaishnavism")
    print(f"Vaishnava deities: {vaishnava['count']}")

    # Explore philosophical concepts
    concepts = api.list_concepts(category="vedanta")
    for c in concepts["results"]:
        print(f"{c['name']} ({c['sanskrit_term']}): {c['description'][:60]}...")

    # Sanskrit glossary
    terms = api.list_glossary()
    for t in terms["results"][:5]:
        print(f"{t['term']} ({t['devanagari']}): {t['definition'][:60]}")

Learn more: Hindu Deities · Concepts · Sanskrit Glossary

Command-Line Interface

Install with CLI support: pip install widegita[cli]

# Show chapter details
widegita chapter 2
# Chapter 2: Sankhya Yoga
# Sanskrit: Sankhya Yoga | Verses: 72

# Read a specific verse (chapter.verse format)
widegita verse 2.47
# BG 2.47
# karmaṇy evādhikāras te mā phaleṣu kadācana...
# You have a right to perform your prescribed duty...

# Use a different translation
widegita verse 2.47 --translation gambhirananda

# Search verse texts
widegita search "dharma"
# Reference | Text
# BG 1.1    | dharmakshetre kurukshetre...
# BG 2.7    | ...dharma-sammudha-cetah...

# Show a Yoga Sutra (pada.number format)
widegita sutra 1.2
# Yoga Sutra 1.2 — Samadhi Pada
# yogas chitta vritti nirodhah
# Yoga is the cessation of the modifications of the mind

# List commentaries
widegita commentaries
widegita commentaries --tradition advaita

# List Upanishads
widegita upanishads
widegita upanishads --principal    # Only 10 principal Upanishads
widegita upanishads --veda yajur   # Filter by Veda

# List Hindu deities
widegita deities
widegita deities --tradition vaishnavism

# List philosophical concepts
widegita concepts
widegita concepts --category yoga

# Sanskrit glossary
widegita glossary

API Reference

Client

Method Arguments Description
WideGita(base_url, timeout) base_url="https://widegita.com", timeout=10.0 Create API client

Chapters

Method Arguments Description
list_chapters() List all 18 Gita chapters
get_chapter(number) number: int Get chapter by number (1-18)

Verses

Method Arguments Description
list_verses(chapter, translation) chapter: int, translation: str List verses with filters
get_verse(chapter, verse, translation) chapter: int, verse: int, translation="sivananda" Get specific verse
search(query, limit) query: str, limit=25 Search verse texts

Commentaries

Method Arguments Description
list_commentaries(tradition) tradition: str | None List commentaries
get_commentary(slug) slug: str Get commentary details
list_commentary_entries(commentary, chapter) commentary: str, chapter: int List commentary entries

Upanishads

Method Arguments Description
list_upanishads(veda, principal_only) veda: str, principal_only: bool List Upanishads
get_upanishad(slug) slug: str Get Upanishad details

Yoga Sutras

Method Arguments Description
list_yoga_sutras(pada) pada: int | None List Yoga Sutras (filter by pada 1-4)
get_yoga_sutra(slug) slug: str (e.g. "1-2") Get Yoga Sutra details

Deities & Concepts

Method Arguments Description
list_deities(tradition, trimurti_only) tradition: str, trimurti_only: bool List Hindu deities
get_deity(slug) slug: str Get deity details
list_concepts(category) category: str | None List philosophical concepts
get_concept(slug) slug: str Get concept details
list_topics() List Gita topics/themes
list_glossary() List Sanskrit glossary terms
get_glossary_term(slug) slug: str Get glossary term details

API Endpoints

Method Endpoint Description
GET /api/v1/gita/chapters/ List all Gita chapters
GET /api/v1/gita/chapters/{number}/ Get chapter by number
GET /api/v1/gita/translations/ List translation editions
GET /api/v1/gita/translations/{code}/ Get translation details
GET /api/v1/gita/verses/ List verses (filterable by chapter, translation)
GET /api/v1/gita/verses/{id}/ Get verse details
GET /api/v1/gita/commentaries/ List commentaries (filterable by tradition)
GET /api/v1/gita/commentaries/{slug}/ Get commentary details
GET /api/v1/gita/commentary-entries/ List commentary entries (filterable)
GET /api/v1/gita/upanishads/ List Upanishads (filterable by veda, is_principal)
GET /api/v1/gita/upanishads/{slug}/ Get Upanishad details
GET /api/v1/gita/yoga-sutras/ List Yoga Sutras (filterable by pada)
GET /api/v1/gita/yoga-sutras/{slug}/ Get Yoga Sutra details
GET /api/v1/gita/deities/ List Hindu deities (filterable by tradition)
GET /api/v1/gita/deities/{slug}/ Get deity details
GET /api/v1/gita/concepts/ List Hindu concepts (filterable by category)
GET /api/v1/gita/concepts/{slug}/ Get concept details
GET /api/v1/gita/topics/ List Gita topics
GET /api/v1/gita/topics/{slug}/ Get topic details
GET /api/v1/gita/glossary/ List Sanskrit glossary terms
GET /api/v1/gita/glossary/{slug}/ Get glossary term details

Example

curl -s "https://widegita.com/api/v1/gita/chapters/2/"
{
  "id": 2,
  "number": 2,
  "name": "Sankhya Yoga",
  "slug": "sankhya-yoga",
  "sanskrit_name": "Sankhya Yoga",
  "description": "The Yoga of Knowledge. Krishna teaches Arjuna about the immortal nature of the Self...",
  "verse_count": 72,
  "yoga_name": "Sankhya Yoga",
  "url": "/chapters/sankhya-yoga/"
}

Full API documentation at widegita.com/developers/. OpenAPI 3.1 spec: widegita.com/api/openapi.json.

Learn More About Hindu Scripture

WideHoly Scripture Platform

Part of the WideHoly open-source multi-religion scripture platform.

Package PyPI Description
widegita PyPI Bhagavad Gita, Upanishads, Yoga Sutras, Hindu deities — widegita.com
widebible PyPI Bible books, chapters, verses, commentaries — widebible.com
widequran PyPI Quran surahs, ayahs, tafsirs, hadiths — widequran.com
widetorah PyPI Torah, Talmud, Mishnah, Rashi commentary — widetorah.com
widesutra PyPI Buddhist sutras, Tipitaka, Mahayana texts — widesutra.com
wideholy PyPI Unified CLI and hub for all 5 religions — wideholy.com

License

MIT License — see LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

widegita-0.1.1.tar.gz (37.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

widegita-0.1.1-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file widegita-0.1.1.tar.gz.

File metadata

  • Download URL: widegita-0.1.1.tar.gz
  • Upload date:
  • Size: 37.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for widegita-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b283279764229938449a1ccede8fe98af8eed05b2b3fb9c7692067dbedbe1b81
MD5 b00174fcd5cdd573ec0f96483164c680
BLAKE2b-256 64a7deb0b1d091db8308bd999bc94c030f7a87daa8f527d116a4c572c8f5548b

See more details on using hashes here.

File details

Details for the file widegita-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: widegita-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for widegita-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 517906ccf7b20401e2d61b53fb199fc9bce649c45206030726ec18dcb8714242
MD5 a2d3e10d1eb016ad3c12a12a24d26efc
BLAKE2b-256 79f3b24d960b2bf8992fc639b2fbda401930ea439add32fa6d2f3c6567fa47f0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page