Skip to main content

Free & Easy translators for Python, such as Google, Microsoft(Bing), Baidu, Alibaba, Tencent, NetEase(Youdao), Sogou, etc.

Project description

translators

PyPI - Version PyPI - License PyPI - Python PyPi - Coverage PyPI - Status PyPI - Wheel

1. Description:

  • Free & Easy translators for Python, such as Google, Microsoft(Bing), Baidu, Alibaba, Tencent, NetEase(Youdao), Sogou, etc.

2. Installation & Tutorials:

  • pip install translators
  • translators.google(query_text, from_language, to_language)
  • detail to help(translators.google)

Examples:

>>>import translators as ts

>>>ts.google('怒发冲冠凭栏处,潇潇雨歇抬望眼。', 'auto', 'en')
"At the anger rushing to the crown, Xiaoxiao Yuxie looked up."

>>>ts.bing('仰天长啸,壮怀激烈。','auto','en')
"The sky is long and squealing, strong and fierce."

>>>ts.baidu('三十功名尘与土,八千里路云和月。', 'wyw', 'en')
"""Over the past 30 years, although some fame has been established, it is as insignificant as the dust. After 
eight thousand miles of war between the north and the south, we have experienced many vicissitudes of life."""

>>>ts.sogou('莫等闲,白了少年头,空悲切。', 'auto', 'en')
"Don't take it for granted, white head, empty sorrow."

>>>ts.youdao('靖康耻,犹未雪。臣子恨,何时灭。驾长车踏破贺兰山缺。', 'auto', 'en')
"Jingkang shame, still not snow. When the courtiers hate, out. Drive a long car through helan mountain."

>>>ts.tencent('壮志饥餐胡虏肉,笑谈渴饮匈奴血。', 'auto', 'en')
"Ambition to eat hungry Hu captive meat, laugh about thirst for Xiongnu blood."

>>>ts.alibaba('待从头,收拾旧山河,朝天阙。', 'auto', 'en')
"Stay from the beginning, clean up the old mountains and rivers, and face the sky."

3. License

Warning: Prohibition of Commercial Use !

This module is designed to help students and individuals with translation services.
For commercial use, please purchase API services from translation suppliers.

4. Dictionary of LANGUAGES:

LANGUAGES = {
    'af': 'afrikaans',
    'sq': 'albanian',
    'am': 'amharic',
    'ar': 'arabic',
    'hy': 'armenian',
    'az': 'azerbaijani',
    'eu': 'basque',
    'be': 'belarusian',
    'bn': 'bengali',
    'bs': 'bosnian',
    'bg': 'bulgarian',
    'ca': 'catalan',
    'ceb': 'cebuano',
    'ny': 'chichewa',
    'zh-CN': 'chinese (simplified)',
    'zh-TW': 'chinese (traditional)',
    'co': 'corsican',
    'hr': 'croatian',
    'cs': 'czech',
    'da': 'danish',
    'nl': 'dutch',
    'en': 'english',
    'eo': 'esperanto',
    'et': 'estonian',
    'tl': 'filipino',
    'fi': 'finnish',
    'fr': 'french',
    'fy': 'frisian',
    'gl': 'galician',
    'ka': 'georgian',
    'de': 'german',
    'el': 'greek',
    'gu': 'gujarati',
    'ht': 'haitian creole',
    'ha': 'hausa',
    'haw': 'hawaiian',
    'iw': 'hebrew',
    'hi': 'hindi',
    'hmn': 'hmong',
    'hu': 'hungarian',
    'is': 'icelandic',
    'ig': 'igbo',
    'id': 'indonesian',
    'ga': 'irish',
    'it': 'italian',
    'ja': 'japanese',
    'jw': 'javanese',
    'kn': 'kannada',
    'kk': 'kazakh',
    'km': 'khmer',
    'ko': 'korean',
    'ku': 'kurdish (kurmanji)',
    'ky': 'kyrgyz',
    'lo': 'lao',
    'la': 'latin',
    'lv': 'latvian',
    'lt': 'lithuanian',
    'lb': 'luxembourgish',
    'mk': 'macedonian',
    'mg': 'malagasy',
    'ms': 'malay',
    'ml': 'malayalam',
    'mt': 'maltese',
    'mi': 'maori',
    'mr': 'marathi',
    'mn': 'mongolian',
    'my': 'myanmar (burmese)',
    'ne': 'nepali',
    'no': 'norwegian',
    'ps': 'pashto',
    'fa': 'persian',
    'pl': 'polish',
    'pt': 'portuguese',
    'pa': 'punjabi',
    'ro': 'romanian',
    'ru': 'russian',
    'sm': 'samoan',
    'gd': 'scots gaelic',
    'sr': 'serbian',
    'st': 'sesotho',
    'sn': 'shona',
    'sd': 'sindhi',
    'si': 'sinhala',
    'sk': 'slovak',
    'sl': 'slovenian',
    'so': 'somali',
    'es': 'spanish',
    'su': 'sundanese',
    'sw': 'swahili',
    'sv': 'swedish',
    'tg': 'tajik',
    'ta': 'tamil',
    'te': 'telugu',
    'th': 'thai',
    'tr': 'turkish',
    'uk': 'ukrainian',
    'ur': 'urdu',
    'uz': 'uzbek',
    'vi': 'vietnamese',
    'cy': 'welsh',
    'xh': 'xhosa',
    'yi': 'yiddish',
    'yo': 'yoruba',
    'zu': 'zulu'
}

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

translators-4.4.2.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

translators-4.4.2-py3.7.egg (23.2 kB view details)

Uploaded Egg

File details

Details for the file translators-4.4.2.tar.gz.

File metadata

  • Download URL: translators-4.4.2.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.3

File hashes

Hashes for translators-4.4.2.tar.gz
Algorithm Hash digest
SHA256 5d63d2b9846f49367fc76068c37d7f1f8007dda786663bc93fdfe8b4684ad2c7
MD5 46817f9a44f1083c50a6e3ca677c1120
BLAKE2b-256 7392dd4c2577cf6a7eaa1808023a355bc9cd4edc33c41a09eb4f862017132b62

See more details on using hashes here.

File details

Details for the file translators-4.4.2-py3.7.egg.

File metadata

  • Download URL: translators-4.4.2-py3.7.egg
  • Upload date:
  • Size: 23.2 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.3

File hashes

Hashes for translators-4.4.2-py3.7.egg
Algorithm Hash digest
SHA256 2cc54f5b3b79d93ffc257426760ee65f722c51762420f67755fe0f9f2ab23244
MD5 e02df1a48d84e02c7ce89d4412092c6c
BLAKE2b-256 e7159fb7e28064f45067e51a23b45d5dd07404faebcaddbaa2d8f6eb30cd9418

See more details on using hashes here.

Supported by

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