dhaturupa
Sanskrit verb conjugation. Give it a root, get back the full paradigm.
pip install dhaturupa
Quick start
from dhaturupa import conjugate
result = conjugate('bhū')
print(result['forms']['prathama']['ekavacana']) # bhavati
print(result['forms']['uttama']['ekavacana']) # bhavāmi
result = conjugate('bhū', lakara='loṭ') # imperative
result = conjugate('bhū', pada='ātmanepada') # override voice
conjugate() returns the 3×3 grid (puruṣa × vacana). get_all_lakaras() does it for all 10 tenses at once.
Reverse lookup
from dhaturupa import get_root, get_root_summary
get_root('bhavati')
# [{'dhatu': 'bhū', 'meaning': 'to be, to become',
# 'lakara': 'laṭ', 'purusha': 'prathama', 'vacana': 'ekavacana', ...}]
get_root_summary('gacchati')
# ['√gam (to go) — laṭ, prathama puruṣa, ekavacana, parasmaipada']
Give it any conjugated form, get back the root and full morphological analysis.
Search and lookup
from dhaturupa import get_dhatu_info, search_dhatus, list_dhatus
get_dhatu_info('gam')
# {'dhatu': 'gam', 'gana': 1, 'meaning': 'to go'}
search_dhatus('to know')
# [{'dhatu': 'budh', ...}, {'dhatu': 'vid', ...}, {'dhatu': 'jñā', ...}]
list_dhatus(gana=4) # all divādi roots
Transliteration
from dhaturupa.transliteration import iast_to_devanagari, devanagari_to_iast
iast_to_devanagari('bhavati') # भवति
devanagari_to_iast('भवति') # bhavati
JSON API
from dhaturupa import conjugate_json, get_root_json
conjugate_json('bhū', pretty=True)
# '{"dhatu": "bhū", "forms": {"prathama": {"ekavacana": "bhavati", ...}}}'
get_root_json('gacchati')
# '[{"dhatu": "gam", "meaning": "to go", "lakara": "laṭ", ...}]'
Every public method has a _json twin. All take pretty=True for indented output. Unicode preserved, not escaped.
CLI
dhaturupa conjugate bhū
# Prathama (3rd) bhavati bhavataḥ bhavanti
# Madhyama (2nd) bhavasi bhavathaḥ bhavatha
# Uttama (1st) bhavāmi bhavāvaḥ bhavāmaḥ
dhaturupa root bhavati
# √bhū (to be, to become) — laṭ, prathama puruṣa, ekavacana
dhaturupa conjugate bhū --lakara loṭ
dhaturupa conjugate bhū --all-lakaras
dhaturupa conjugate bhū --json
dhaturupa search "to know"
dhaturupa list --gana 1
What's inside
85+ roots across all 10 gaṇas. 10 lakāras. Both parasmaipada and ātmanepada. Guṇa/vṛddhi gradation, vikaraṇa suffixes, sandhi, and pre-computed irregular stems. Zero dependencies.
License
MIT © Hemanth.HM
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dhaturupa-0.3.0.tar.gz.
File metadata
- Download URL: dhaturupa-0.3.0.tar.gz
- Upload date:
- Size: 22.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5152ddb3cfea593c5c646c190077f5b5af7cfaab642836e3d2cd083a0b90eff
|
|
| MD5 |
3ad5279c47606e2a42f62aa66d8ce20e
|
|
| BLAKE2b-256 |
c31e38196c7cc2a45b05f8b723f35728961e4dd0f84a278aa379a9efe619628d
|
File details
Details for the file dhaturupa-0.3.0-py3-none-any.whl.
File metadata
- Download URL: dhaturupa-0.3.0-py3-none-any.whl
- Upload date:
- Size: 21.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0cecae1819f49d3d71a926d6bec04869797d1f2953c632ce94cd055072f7cff7
|
|
| MD5 |
27a66fd08cf8149df6251c5b40f9051f
|
|
| BLAKE2b-256 |
ecd559eb537aa1c9dfc76e1eebb6a44440f19eb96b3a081067defb730e552314
|