项目作者: imWildCat

项目描述 :
The Python wrapper for Sogou Translate API.
高级语言: Python
项目地址: git://github.com/imWildCat/sogou-translate.git
创建时间: 2018-04-08T17:11:23Z
项目社区:https://github.com/imWildCat/sogou-translate

开源协议:Do What The F*ck You Want To Public License

下载


Sogou-Translate Build Status codecov PyPI version

The Python wrapper for Sogou Translate API. Only Python 3.6 is supported.

sogou_translate_logo

Get started

You could install this library using pip:

  1. pip install sogou-translate

Note: You might have to apply for the keys in order to use the service. If you wish to have a brief demo of this service, you could use the demo keys mentioned in the related web pages.

Example usage

  1. from sogou_translate import SogouTranslate, SogouLanguages
  2. trans = SogouTranslate('[Your pid]', '[Your secret key]')
  3. en_text = 'Hello, world!'
  4. zh_text = trans.translate(en_text, from_language=SogouLanguages.EN, to_language=SogouLanguages.ZH_CHS)
  5. print(zh_text) # '你好,世界!'

License

The code is licensed under DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE. For more details, read the LICENSE file.