Convert among Devanagari transliteration schemes
Project description
Devanagari Transliterators
Convert among common Devanagari transliteration schemes. The following codecs are currently integrated.
System | Code | Decoder | Encoder |
---|---|---|---|
Devanagari | dev |
✓ | ✓ |
IAST | iast |
✓ | ✓ |
WX | wx |
✓ | ✓ |
SLP1 | slp |
✓ | ✓ |
Velthuis | vel |
✓ | ✓ |
(La)TeX | tex |
✗ | ✓ |
Installation
The best method to install is via pip
.
pip3 install devtrans
Clone the GitLab repository to install from the source or to contribute.
Usage
As a script
transliterate -d dev -e iast -i input_file -o outputfile
The options
-d
Decoder system code (defaults todev
)-e
Encoder system code (defaults toiast
)-i
Input file (defaults toSTDIN
)-o
Output file (defaults toSTDOUT
)
See help for more details
transliterate --help
As a module
Import the module.
import devtrans
Call any codec function with appropriate input text
target = devtrans.wx2iast('xevanAgarI')
Devanagari encoders can have an optional boolean argument. If True
, which is default, the encoder transliterates digits to Devanagari digits. If False
, it leaves digits as it is.
target = devtrans.wx2dev('BagavaxgIwA 18.78', False)
Disclaimer
It has primarily been developed for personal use as a tea-time activity. Some of my colleagues and I are using it since 2015 for general texts from classical literature. I have been tweaking and making modifications whenever we found an issue.
However, the transliterators are not tested exhaustively or thoroughly with various kinds of texts.
Contribute
Find the repo on GitLab. If found bugs, please fix and push them, raise an issue or mail me.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.