Package: translate
Translate is a simple but powerful translation tool written in python with with support for
multiple translation providers. By now we offer integration with Microsoft Translation API,
Translated MyMemory API, LibreTranslate, and DeepL’s free and pro APIsWhy Should I Use This?The biggest reason to use translate is to  make translations in a simple way without the need of bigger
effort and can be used as a translation tool like command lineInstallation$pipinstalltranslateOr, you can download the source and$pythonsetup.pyinstallPrefix ‘sudo’ if you encounter a problem.FeaturesTranslate your output in real timeDo translation in your terminal using the command lineUsageIn your command-line:$translate-cli-tzh"This is a pen."Translation:这是一支笔-------------------------Translatedby:MyMemoryOr$translate-cli-tzh"This is a pen."-o这是一支笔Options$translate-cli--helpUsage:__main__.py[OPTIONS]TEXT...PythoncommandlinetooltomakeonlinetranslationsExample:$translate-cli-tzhthebookisonthetable碗是在桌子上。Availablelanguages:https://en.wikipedia.org/wiki/ISO_639-1Examples:(e.g.en,ja,ko,pt,zh,zh-TW,...)Options:--versionShowtheversionandexit.--generate-config-fileGeneratetheconfigfileusingaWizardandexit.-f,--fromTEXTSetsthelanguageofthetextbeingtranslated.Thedefaultvalueis'autodetect'.-t,--toTEXTSetthelanguageyouwanttotranslate.-p,--providerTEXTSettheprovideryouwanttouse.Thedefaultvalueis'mymemory'.--secret_access_keyTEXTSetthesecretaccesskeyusedtogetprovideroAuthtoken.-o,--output_onlySettodisplaythetranslationonly.--helpShowthismessageandexit.Change Default LanguagesIn ~/.python-translate.cfg:[DEFAULT]from_lang=autodetectto_lang=deprovider=mymemorysecret_access_key=The cfg is not for use as a Python module.or run the command line and follow the steps:$translate-cli--generate-config-fileTranslatefrom[autodetect]:Translateto:<languageyouwanttotranslate>Provider[mymemory]:SecretAccessKey[]:Use As A Python ModuleIn[1]:fromtranslateimportTranslatorIn[2]:translator=Translator(to_lang="zh")In[3]:translation=translator.translate("This is a pen.")Out[3]:这是一支笔The result is usually a unicode string.Use a different translation providerIn[1]:fromtranslateimportTranslatorIn[2]:to_lang='zh'In[3]:secret='<your secret from Microsoft or DeepL>'In[4]:translator=Translator(provider='<the name of the provider, eg. microsoft or deepl>',to_lang=to_lang,secret_access_key=secret)In[5]:translator.translate('the book is on the table')Out[5]:'碗是在桌子上。'The DeepL ProviderTo use DeepL’s pro API, pass an additional parameter called pro to the Translator object and set it to True and use your pro authentication key as the secret_access_keyIn:translator=Translator(provider='microsoft',to_lang=to_lang,secret_access_key=secret,pro=True)DocumentationCheck out the latesttranslatedocumentation atRead the DocsContributingPlease send pull requests, very much appreciated.Fork therepositoryon GitHub.Make a branch off of master and commit your changes to it.Install requirements.pip install-rrequirements-dev.txtInstall pre-commit.pre-commitinstallRun the tests withpy.test-vv-sCreate a Pull Request with your contributionChangelog3.6.1Add LibreTranslate3.5.0Add sphinx documentationUpdate readme.3.4.1Makefile: Add a make release commandAdd twine to dev requirements.3.4.0Refactor: Create a folder to add all providers instead to let in a single fileAdd Microsoft providerAdd more documentation to all providers (Translated-MyMemory and Microsoft Translator)Add arguments to change the default provider using translate-cli3.3.0Refactor translate-cli (command line interface) Using Click library instead of ArgParserUnify translate-cli and main to avoid duplicate codeAdd documentation to be used on helper commands on translate-cliRemove unnecessary codeRefactor setup to complete information in the PKG-INFO used by PyPI3.2.1Change the license from “BEER-WARE” to MIT3.2.0Add multiple providers suport3.1.0Apply Solid PrinciplesOrganize ProjectAdd pre-commit, pytestAdd new Make fileAdd new test cases3.0.0General RefactorRemove urllib to use requestsRefactor methods names removing google from thenApply PEP8Change contructor to keep it the code simple2.0.0 (2017-11-08)initial release using changes file