前情提要: https://www.sunp.eu.org/t/430327
Github: https://github.com/imWildCat/sogou-translate
Sogou-Translate

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

以下内容来源于搜狗翻译。
开始吧
您可以使用pip安装此库:
pip install sogou-translate
注:您可能需要申请密钥才能使用该服务。如果您希望简要演示此服务,可以使用相关网页中提到的演示密钥。
示例用法
from sogou_translate import SogouTranslate, SogouLanguages
trans = SogouTranslate('[Your pid]', '[Your secret key]')
en_text = 'Hello, world!'
zh_text = trans.translate(en_text, from_language=SogouLanguages.EN, to_language=SogouLanguages.ZH_CHS)
print(zh_text) # '你好,世界!'
License
代码是在做你他妈的想公开许可下许可的。有关详细信息,请阅读 LICENSE 文件。