Skip to main content

Convert among Devanagari transliteration systems

Project description

Devanagari Transliterators

Convert among common Devanagari transliteration systems. The following codecs are currently implemented.

System Code Decoder Encoder
Devanagari dev
Hardvard Kyoto hk
IAST iast
ITRANS itrans
SLP1 slp
(La)TeX tex
Velthuis vel
WX wx

Installation

The best method to install is via pip.

pip3 install devtrans

Clone the GitLab repository to install from the source.

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 to iast)
  • -i Input file (defaults to STDIN)
  • -o Output file (defaults to STDOUT)

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.

Majority of the transliteration schemes are case-sensitive. Currently, encoder/decoder for case-insensitve schemes works with lowercase characers only.

Many schemes use punctuation characters to represent letters which are represented using alphabets in another scheme. This makes punctuated text to be poorly transliterated. No character-escape mechanism is used.

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.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

devtrans-3.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file devtrans-3.0-py3-none-any.whl.

File metadata

  • Download URL: devtrans-3.0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.8.0 tqdm/4.43.0 CPython/3.8.2

File hashes

Hashes for devtrans-3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2079f69f7a80cda80cac44e4b53b0157ae594011cea1560023d0ca12f2e2ad7c
MD5 4533c50e09808d5c3455b8a2844b08a3
BLAKE2b-256 4e1fb09563479c4c865821e7ea519489e05ce1411232998235e4cb2e8cc5b00c

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