This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

A translation package

Project Description

Chinese Version

translation is a python translation package based on website service.

It provids google, youdao, baidu, iciba translation service.


pip install translation


from translation import baidu, google, youdao, iciba

print(google('hello world!', dst = 'zh-CN'))
print(google('hello world!', dst = 'ru'))
print(baidu('hello world!', dst = 'zh'))
print(baidu('hello world!', dst = 'ru'))
print(youdao('hello world!', dst = 'zh-CN'))
print(iciba('hello world!', dst = 'zh'))
print(bing('hello world!', dst = 'zh-CHS'))


You may find document here

Advanced usage


You may not use some of the function without proxies.

Proxies can be set as following.

from translation import google, ConnectError

# is a vaild proxies
    print(google('hello world!', dst = 'zh-CN', proxies = {'http': ''}))
except ConnectError:
    print('Invaild proxy')


You may change default setting such as:

  • default source language (auto if not set)
  • default destination language (zh-CN if not set)
  • default translation (youdao if not set)
  • default proxies (no proxy if not set)
from translation import (set_default_translation, set_default_language,
    set_default_proxies, get, ConnectError)

set_default_language('auto', 'zh-CN')
set_default_proxies({'http': ''})
    print(get('hello world!'))
except ConnectError:
    print('Invaild proxy')


More functions are introduced in the document.


Language list of all the translation are provided in document.

Somehow, iciba and youdao can only provide English translation.


el    : Greek,
eo    : Esperanto,
en    : English,
af    : Afrikaans,
sw    : Swahili,
ca    : Catalan,
it    : Italian,
iw    : Hebrew,
sv    : Swedish,
cs    : Czech,
cy    : Welsh,
ar    : Arabic,
ur    : Urdu,
ga    : Irish,
eu    : Basque,
et    : Estonian,
az    : Azerbaijani,
id    : Indonesian,
es    : Spanish,
ru    : Russian,
gl    : Galician,
nl    : Dutch,
pt    : Portuguese,
la    : Latin,
tr    : Turkish,
tl    : Filipino,
lv    : Latvian,
lt    : Lithuanian,
th    : Thai,
vi    : Vietnamese,
gu    : Gujarati,
ro    : Romanian,
is    : Icelandic,
pl    : Polish,
ta    : Tamil,
yi    : Yiddish,
be    : Belarusian,
fr    : French,
bg    : Bulgarian,
uk    : Ukrainian,
hr    : Croatian,
bn    : Bengali,
sl    : Slovenian,
ht    : Haitian Creole,
da    : Danish,
fa    : Persian,
hi    : Hindi,
fi    : Finnish,
hu    : Hungarian,
ja    : Japanese,
ka    : Georgian,
te    : Telugu,
zh-TW : Chinese Traditional,
sq    : Albanian,
no    : Norwegian,
ko    : Korean,
kn    : Kannada,
mk    : Macedonian,
zh-CN : Chinese Simplified,
sk    : Slovak,
mt    : Maltese,
de    : German,
ms    : Malay,
sr    : Serbian


If you have any problem or suggestion, you may contact me in this issue.

Release History

Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
translation-1.0.5-py2-none-any.whl (12.3 kB) Copy SHA256 Checksum SHA256 py2 Wheel Jul 17, 2016
translation-1.0.5-py3-none-any.whl (9.3 kB) Copy SHA256 Checksum SHA256 py3 Wheel Jul 17, 2016 (14.5 kB) Copy SHA256 Checksum SHA256 Source Jul 17, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting