Skip to main content

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

dhaturupa-0.3.0.tar.gz (22.7 kB view details)

Uploaded Source

Built Distribution

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

dhaturupa-0.3.0-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

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

Hashes for dhaturupa-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a5152ddb3cfea593c5c646c190077f5b5af7cfaab642836e3d2cd083a0b90eff
MD5 3ad5279c47606e2a42f62aa66d8ce20e
BLAKE2b-256 c31e38196c7cc2a45b05f8b723f35728961e4dd0f84a278aa379a9efe619628d

See more details on using hashes here.

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

Hashes for dhaturupa-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0cecae1819f49d3d71a926d6bec04869797d1f2953c632ce94cd055072f7cff7
MD5 27a66fd08cf8149df6251c5b40f9051f
BLAKE2b-256 ecd559eb537aa1c9dfc76e1eebb6a44440f19eb96b3a081067defb730e552314

See more details on using hashes here.

Release history Release notifications | RSS feed

0.4.0

2 files

This release

0.3.0 This release

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

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