All Projects → foyoux → pygtrans

foyoux / pygtrans

Licence: GPL-3.0 license
谷歌翻译, 支持 APIKEY 一口气翻译十万条

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to pygtrans

Cyrillic To Translit Js
Ultra-lightweight JavaScript library for converting Cyrillic symbols to Translit and vice versa
Stars: ✭ 91 (+51.67%)
Mutual labels:  translation, translate
Deeply
PHP client for the DeepL.com translation API (unofficial)
Stars: ✭ 152 (+153.33%)
Mutual labels:  translation, translate
Dynamictranslator
Instant translation application for windows in .NET 🎪
Stars: ✭ 131 (+118.33%)
Mutual labels:  translation, translate
React Intl Hooks
React hooks for internationalization without the hassle ⚛️🌍
Stars: ✭ 64 (+6.67%)
Mutual labels:  translation, translate
Traduzir Paginas Web
Translate your page in real time using Google or Yandex.
Stars: ✭ 214 (+256.67%)
Mutual labels:  translation, translate
Google Translate Php
🌐 Free Google Translate API PHP Package. Translates totally free of charge.
Stars: ✭ 1,131 (+1785%)
Mutual labels:  translation, translate
Deepl Translator
This module provides promised methods for translating text using DeepL Translator (https://www.deepl.com/translator) undocumented API.
Stars: ✭ 145 (+141.67%)
Mutual labels:  translation, translate
Translators
🌏🌍🌎Translators🌎🌍🌏 is a library which aims to bring free, multiple, enjoyable translation to individuals and students in Python. Translators是一个旨在用Python为个人和学生带来免费、多样、愉快翻译的库。
Stars: ✭ 295 (+391.67%)
Mutual labels:  translation, translate
Lingvo
Lingvo
Stars: ✭ 2,361 (+3835%)
Mutual labels:  translation, tts
Php Google Translate Free
PHP class to use the Google Translator API for free.
Stars: ✭ 182 (+203.33%)
Mutual labels:  translation, translate
Libretranslate
Free and Open Source Machine Translation API. 100% self-hosted, no limits, no ties to proprietary services. Built on top of Argos Translate.
Stars: ✭ 834 (+1290%)
Mutual labels:  translation, translate
Deep Translator
A flexible free and unlimited python tool to translate between different languages in a simple way using multiple translators.
Stars: ✭ 233 (+288.33%)
Mutual labels:  translation, translate
Fluent
Fluent — planning, spec and documentation
Stars: ✭ 818 (+1263.33%)
Mutual labels:  translation, translate
Androiddeepl
Unofficial Android application of DeepL Translator
Stars: ✭ 86 (+43.33%)
Mutual labels:  translation, translate
Polyglot
🌏 The missing Safari extension that translates selected text into your native language.
Stars: ✭ 387 (+545%)
Mutual labels:  translation, translate
Google Translate Open Api
A free and unlimited API for Google Translate(support single text and Multi-segment text) 💵🚫
Stars: ✭ 132 (+120%)
Mutual labels:  translation, translate
whats
🌐 a terminal translation tool
Stars: ✭ 16 (-73.33%)
Mutual labels:  translation, translate
linguist
Linguist is a powerful browser extension for translate pages and text, which are ready to replace your favorite translate service
Stars: ✭ 21 (-65%)
Mutual labels:  translation, translate
React Translated
A dead simple way to add complex translations (i18n) in a React (DOM/Native) project 🌎🌍🌏
Stars: ✭ 176 (+193.33%)
Mutual labels:  translation, translate
Tms
基于频道模式的团队沟通协作+轻量级任务看板,支持mardown、富文本、在线表格和思维导图的团队博文wiki,i18n国际化翻译管理的响应式web开源团队协作系统。
Stars: ✭ 232 (+286.67%)
Mutual labels:  translation, translate

pygtrans

谷歌翻译, 支持 APIKEY

Downloads

安装

pip install -U pygtrans

基本功能

  • 获取语言支持列表
  • 自动检测语言, 支持批量
  • 文本/HTML 翻译, 支持批量
  • 支持 TTS

快速入门

from pygtrans import Translate

client = Translate(proxies={'https': 'http://localhost:10809'})

# 检测语言
text = client.detect('Answer the question.')
assert text.language == 'en'

# 翻译句子
text = client.translate('Look at these pictures and answer the questions.')
assert text.translatedText == '看这些图片,回答问题。'

# 批量翻译
texts = client.translate([
    'Good morning. What can I do for you?',
    'Read aloud and underline the sentences about booking a flight.',
    'May I have your name and telephone number?'
])
assert [text.translatedText for text in texts] == [
    '早上好。我能为你做什么?',
    '大声朗读并在有关预订航班的句子下划线。',
    '可以给我你的名字和电话号码吗?'
]

# 翻译到日语
text = client.translate('请多多指教', target='ja')
assert text.translatedText == 'お知らせ下さい'

# 翻译到韩语
text = client.translate('请多多指教', target='ko')
assert text.translatedText == '조언 부탁드립니다'

# 文本到语音
tts = client.tts('やめて', target='ja')
open('やめて.mp3', 'wb').write(tts)

最佳实践

  1. pygtrans中包含两个翻译模块
    1. Translate:
      • 完全免费,支持批量
      • 从2021年9月15日开始, 需要翻墙才能使用, 具体参考 #8
    2. ApiKeyTranslate: 需要有效的谷歌翻译 API KEY谷歌提供免费试用
  2. Translate的最佳实践:
    1. http 代理:Translate(proxies={"https": "http://localhost:10809"})
    2. socks5 代理: Translate(proxies={"https": "socks5://localhost:10808"})
    3. 重要:尽量一次性多翻译,减少请求次数,参考 #13,比如一次性翻译 2000 / 5000 / 10000
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].