A Python library to use Google Transliterate API which powers the G Input Tools.
Install using:
pip install google-transliteration-api
Note:
Check here for list of supported languages.
from google.transliteration import transliterate_word
suggestions = transliterate_word('America', lang_code='ja')
print(suggestions)
[‘アメリカ’, ‘米国’, ‘米’, ‘亜米利加’, ‘亜墨利加’, ‘米利堅’]
The above transliterates the word ‘America’ into Japanese script and returns a list of possible suggestions.
(Experimental)
from google.transliteration import transliterate_text
result = transliterate_text('Hello comrade!', lang_code='ru')
print(result)
хелло комраде!
from google.transliteration import transliterate_numerals
result = transliterate_numerals('3210', lang_code='zh')
print(result)
三二一〇
Please feel free to contribute by Pull Requests or raise an issue.
If you’re Google and want us to take down the API, please raise an issue mentioning the main contributors.