Skip to main content

Free Translate(google/deepl) API for Python

Project description

Quick Start

supported google and deepl

import mytrans

r = mytrans.google('August 22, 2020 The sky became pitch black due to sudden rain and thunder from the afternoon', target_lang='zh-CN')
print(r.res)	# result of list 
print(r.text)	# source result (unprocessed)
print(r.json)	# source result to dict

r = mytrans.deepl('2020年8月22日 午後から急に雨が降ったり雷が鳴ったりして空が真っ暗になった', target_lang='zh')
print(r.res)

Supported Languages

google 和 deepl 的 lang_code有些不同,需自行识别。

The lang_code of google and deepl is a little different, so you need to identify it yourself.

这里列出常用的 lang_code:

Common lang_code are listed here:

deepl 只支持下列几种,google则更多。

deepl only supports the following, google has more.

  • 中文(Chinese): zh (deepl), zh-CN (google)

  • 英语(English): en

  • 德语(German): de

  • 法语(French): fr

  • 西班牙语(Spanish): es

  • 葡萄牙语(Portuguese): pt

  • 意大利语(Italian): it

  • 荷兰语(Dutch): nl

  • 波兰语(Polish): pl

  • 俄语(Russian): ru

  • 日语(Japanese): ja

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mytrans-0.0.1.tar.gz (4.2 kB view hashes)

Uploaded Source

Built Distribution

mytrans-0.0.1-py3-none-any.whl (6.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page