All Projects → DavideGalilei → gpytranslate

DavideGalilei / gpytranslate

Licence: MIT license
A Python3 library for translating text using Google Translate API.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to gpytranslate

translate
A module grouping multiple translation APIs
Stars: ✭ 321 (+844.12%)
Mutual labels:  translator, translate
linguist
Linguist is a powerful browser extension for translate pages and text, which are ready to replace your favorite translate service
Stars: ✭ 21 (-38.24%)
Mutual labels:  translator, translate
DocumentTranslation
Command Line tool and Windows application for document translation, a local interface to the Azure Document Translation service for Windows, macOS and Linux.
Stars: ✭ 61 (+79.41%)
Mutual labels:  translator, translate
php-google-translate-for-free
Library for free use Google Translator. With attempts connecting on failure and array support.
Stars: ✭ 124 (+264.71%)
Mutual labels:  translator, translate
Translator3000
Automatic translator of games made on Ren'Py engine.
Stars: ✭ 78 (+129.41%)
Mutual labels:  translator, translate
deepl-php-lib
🧠 DeepL API Client Library supporting PHP >= 7.3
Stars: ✭ 50 (+47.06%)
Mutual labels:  translator, translate
tr4n5l4te
Use Google Translate without an API key.
Stars: ✭ 32 (-5.88%)
Mutual labels:  translator, translate
node-google-translate-skidz
Simple Node.js library for talking to Google's Translate API for free.
Stars: ✭ 70 (+105.88%)
Mutual labels:  translator, translate
Misakatranslator
御坂翻译器—Galgame/文字游戏/漫画多语种实时机翻工具
Stars: ✭ 2,211 (+6402.94%)
Mutual labels:  translator, translate
bing-translate-api
A simple and free API for Bing Translator for Node.js
Stars: ✭ 37 (+8.82%)
Mutual labels:  translator, translate
SimpleTranslationSystem
A simple C# translation system
Stars: ✭ 14 (-58.82%)
Mutual labels:  translator, translate
googletrans
G文⚡️: Concurrency-safe, Free and Unlimited google translate api for Golang. 🔥免费、无限、并发安全的谷歌翻译包
Stars: ✭ 94 (+176.47%)
Mutual labels:  translator, googletrans
react-translator-component
React language translation module for developing a multilingual project.
Stars: ✭ 13 (-61.76%)
Mutual labels:  translator, translate
HighlightTranslator
Highlight Translator can help you to translate the words quickly and accurately. By only highlighting, copying, or screenshoting the content you want to translate anywhere on your computer (ex. PDF, PPT, WORD etc.), the translated results will then be automatically displayed before you.
Stars: ✭ 54 (+58.82%)
Mutual labels:  translator, translate
LibreTranslate
Free and Open Source Machine Translation API. Self-hosted, offline capable and easy to setup.
Stars: ✭ 3,932 (+11464.71%)
Mutual labels:  translator, translate
spacy-langdetect
A fully customisable language detection pipeline for spaCy
Stars: ✭ 86 (+152.94%)
Mutual labels:  googletrans
learnrxjs
Русскоязычная документация RxJS
Stars: ✭ 20 (-41.18%)
Mutual labels:  translate
sogou-translate
The Python wrapper for Sogou Translate API.
Stars: ✭ 38 (+11.76%)
Mutual labels:  translate
xentica
GPU-accelerated engine for multi-dimensional cellular automata
Stars: ✭ 29 (-14.71%)
Mutual labels:  translator
sketch-crowdin
Connect your Sketch and Crowdin projects together
Stars: ✭ 35 (+2.94%)
Mutual labels:  translate

gpytranslate

A Python3 library for translating text using Google Translate API.


Features

  • Both Synchronous and Asynchronous
  • Dot accessible values
  • Supports emoji
  • Type hinted
  • Free to use
  • Easy

Quick Start

Installation

Requirements:

  • Python 3.6 or higher.
$ python3 -m pip install -U gpytranslate

Usage

Async Example:

from gpytranslate import Translator
import asyncio


async def main():
    t = Translator()
    translation = await t.translate("Ciao come stai? Io bene ahah.", targetlang="en")
    language = await t.detect(translation.text)
    print(f"Translation: {translation.text}\nDetected language: {language}")


if __name__ == "__main__":
    asyncio.run(main())

Sync Example:

from gpytranslate import SyncTranslator

t = SyncTranslator()
translation = t.translate("Ciao come stai? Io bene ahah.", targetlang="en")
language = t.detect(translation.text)
print(f"Translation: {translation.text}\nDetected language: {language}")

Note: you could also check tests folder for extra examples.

Output:

Translation: Hello how are you? I'm fine, haha.
Detected language: en

Text to Speech

Async Example:

import asyncio, aiofiles
from gpytranslate import Translator

async def main():
    translator = Translator()
    async with aiofiles.open("test.mp3", "wb") as file:
        await translator.tts("Hello world!", file=file)

if __name__ == "__main__":
    asyncio.run(main())

Sync Example:

from gpytranslate import SyncTranslator

translator = SyncTranslator()

with open("test.mp3", "wb") as file:
    translator.tts("Hello world!", file=file)

Useful Resources

https://danpetrov.xyz/programming/2021/12/30/telegram-google-translate.html https://vielhuber.de/en/blog/google-translation-api-hacking/


Development

Want to contribute? Pull requests are accepted!


License

Licensed under the MIT License.

Click here for further information.

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].