Description • Installation • Examples • Changes • License • Maintenance • Owner
The goal of this code is to provide a library to convert back and forth between Tibetan Unicode and EWTS. The code is adapted from Java ewts-converter.
It also provides a conversion from the ACIP Transliteration to EWTS.
pip install pyewts
Convert Wylie to Unicode
import pyewts
converter = pyewts.pyewts()
print(converter.toUnicode("ba b+ba [a] ba\\u0f0b"))
# བ་བྦ་a་བ་
Convert Unicode to Wylie
print(converter.toWylie("༼༽"))
# ()
Catch Wylie warnings
>>> orig = """dangs
... zhwa
... dwang
... rma
... tshe
... phywa
... dge
... rgya
... dwags
... (rtse mgron)"""
>>>
>>> print(orig)
dangs
zhwa
dwang
rma
tshe
phywa
dge
rgya
dwags
(rtse mgron)
>>> warns = []
>>> res = converter.toUnicode(orig, warns)
>>> print(res)
དངས
ཞྭ
དྭང
རྨ
ཚེ
ཕྱྭ
དགེ
རྒྱ
དྭགས
༼རྩེ་མགྲོན༽
>>> print(warns)
['line 1: "dangs": Syllable should probably be "dngas".']
See demo.py
See CHANGELOG.md.
The Python code is Copyright (C) 2018 Esukhia, provided under MIT License. See CONTRIBUTORS.md for a list of authors and contributors.
Build the source dist:
rm -rf dist/
python3 setup.py clean sdist
and upload on twine (version >= 1.11.0
) with:
twine upload dist/*