Package: dragotrans
Dragotrans is afreeandunlimitedpython library that
will recognize and translate language from the text.Compatible with Python 3.6+..FeaturesFast and reliable
translate.google.com usesAuto language detectionBulk translationsCustomizable service URLHTTP/2 supportTODOmore features are coming soon.Proxy supportInternal session management (for better bulk translations)HTTP/2 supportThis library uses httpx for HTTP requests so HTTP/2 is supported by default.InstallationTo install, either use things like pip with the package “dragotrans”
or download the package and put the “dragotrans” directory into your
python path.$pipinstalldragotransBasic UsageIf source language is not given, this library translate attempts to detect the
source language.>>>fromdragotransimportTranslator>>>translator=Translator()>>>translator.translate('안녕하세요.')# <Translated src=ko dest=en text=Good evening. pronunciation=Good evening.>>>>translator.translate('안녕하세요.',dest='ja')# <Translated src=ko dest=ja text=こんにちは。 pronunciation=Kon'nichiwa.>>>>translator.translate('veritas lux mea',src='la')# <Translated src=la dest=en text=The truth is my light pronunciation=The truth is my light>Advanced Usage (Bulk)Array can be used to translate a batch of strings in a single method
call and a single HTTP session. The exact same method shown above works
for arrays as well.>>>translations=translator.translate(['The quick brown fox','jumps over','the lazy dog'],dest='ko')>>>fortranslationintranslations:...print(translation.origin,' -> ',translation.text)# The quick brown fox  ->  빠른 갈색 여우# jumps over  ->  이상 점프# the lazy dog  ->  게으른 개Language detectionThe detect method, as its name implies, identifies the language used in
a given sentence.>>>fromdragotransimportTranslator>>>translator=Translator()>>>translator.detect('이 문장은 한글로 쓰여졌습니다.')# <Detected lang=ko confidence=0.27041003>>>>translator.detect('この文章は日本語で書かれました。')# <Detected lang=ja confidence=0.64889508>>>>translator.detect('This sentence is written in English.')# <Detected lang=en confidence=0.22348526>>>>translator.detect('Tiu frazo estas skribita en Esperanto.')# <Detected lang=eo confidence=0.10538048>DragoTrans as a command line application$translate-husage:translate[-h][-dDEST][-sSRC][-c]textPythonGoogleTranslatorasacommand-linetoolpositionalarguments:textThetextyouwanttotranslate.optionalarguments:-h,--helpshowthishelpmessageandexit-dDEST,--destDESTThedestinationlanguageyouwanttotranslate.(Default:en)-sSRC,--srcSRCThesourcelanguageyouwanttotranslate.(Default:auto)-c,--detect$translate"veritas lux mea"-sla-den[veritas]veritasluxmea->[en]Thetruthismylight[pron.]Thetruthismylight$translate-c"안녕하세요."[ko,1]안녕하세요.Note on library usageContributingContributions are more than welcomed. SeeCONTRIBUTING.mdLicenseDragotrans is licensed under the MIT License. The terms are as
follows:The MIT License (MIT)

Copyright (c) 2020 Emerger

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.