Easy Google Translate: Unofficial Google Translate API

Overview

easygoogletranslate

Unofficial Google Translate API.

This library does not need an api key or something else to use, it's free and simple. You can either use a string or a file to translate but the text must be equal to or less than 5000 character. You can split your text into 5000 characters to translate more.

Google Translate supports 108 different languages. You can use any of them as source and target language in this application. If source language is not specified, it will detect source language automatically. This application supports multi thread translation, you can use it to translate multiple languages at once. Detailed language list can be found here: https://cloud.google.com/translate/docs/languages

Installation:

The easiest way to install easygoogletranslateis to download it from PyPI. Then you will be able to use the library.

pip install easygoogletranslate

Examples:

  1. Specify default source and target language at beginning and use it any time.
from easygoogletranslate import EasyGoogleTranslate

translator = EasyGoogleTranslate(
    source_language='en',
    target_language='de',
    timeout=10
)
result = translator.translate('This is an example.')

print(result) 
# Output: Dies ist ein Beispiel.
  1. Don't specify default parameters.
from easygoogletranslate import EasyGoogleTranslate

translator = EasyGoogleTranslate()
result = translator.translate('This is an example.', target_language='tr')

print(result)
# Output: Bu bir örnektir.
  1. Override default parameters.
from easygoogletranslate import EasyGoogleTranslate

translator = EasyGoogleTranslate(target_language='tr')
result = translator.translate('This is an example.', target_language='fr')

print(result)
# Output: Ceci est un exemple.
  1. Translate a text in multiple languages at once via multi-threading.
from easygoogletranslate import EasyGoogleTranslate

translator = EasyGoogleTranslate()
result = translator.translate(text='This is an example.', target_language=['tr', 'fr', 'de'])

print(result)
# Output: ['Bu bir örnektir.', 'Ceci est un exemple.', 'Dies ist ein Beispiel.']
  1. Translate a file in multiple languages at once via multi-threading.
from easygoogletranslate import EasyGoogleTranslate

translator = EasyGoogleTranslate()
result = translator.translate_file(file_path='text.txt', target_language=['tr', 'fr', 'de'])

print(result)
# Output: ['Nasılsın?', 'Comment ca va?', 'Wie geht es Ihnen?']
# Text inside file: How are you?
You might also like...
rewise is an unofficial wrapper for google search's auto-complete feature

rewise is an unofficial wrapper for google search's auto-complete feature

The unofficial Amazon search CLI & Python API
The unofficial Amazon search CLI & Python API

amzSear The unofficial Amazon Product CLI & API. Easily search the amazon product directory from the command line without the need for an Amazon API k

Unofficial GoPro API Library for Python - connect to GoPro via WiFi.
Unofficial GoPro API Library for Python - connect to GoPro via WiFi.

GoPro API for Python Unofficial GoPro API Library for Python - connect to GoPro cameras via WiFi. Compatibility: HERO3 HERO3+ HERO4 (including HERO Se

Unofficial Python wrapper for official Hacker News API

haxor Unofficial Python wrapper for official Hacker News API. Installation pip install haxor Usage Import and initialization: from hackernews import H

Unofficial Medium Python Flask API and SDK
Unofficial Medium Python Flask API and SDK

PyMedium - Unofficial Medium API PyMedium is an unofficial Medium API written in python flask. It provides developers to access to user, post list and

Unofficial Python API client for Notion.so
Unofficial Python API client for Notion.so

notion-py Unofficial Python 3 client for Notion.so API v3. Object-oriented interface (mapping database tables to Python classes/attributes) Automatic

An Unofficial TikTok API Wrapper In Python

This is an unofficial api wrapper for TikTok.com in python. With this api you are able to call most trending and fetch specific user information as well as much more.

✖️ Unofficial API of 1337x.to
✖️ Unofficial API of 1337x.to

✖️ Unofficial Python API Wrapper of 1337x This is the unofficial API of 1337x. It supports all proxies of 1337x and almost all functions of 1337x. You

Unofficial YooMoney API python library

API Yoomoney - unofficial python library This is an unofficial YooMoney API python library. Summary Introduction Features Installation Quick start Acc

Comments
  • apostrophe is not detected ??

    apostrophe is not detected ??

    Problem

    • Apostrophe isnt being detected

    Desired result

    Bankman-Fried, the former CEO of bankrupt cryptocurrency exchange FTX, lost his entire $16 billion fortune in one of the largest losses in history, reports Bloomberg. At the peak of the business, the entrepreneur's fortune was estimated at $ 26 billion. If you allow me, I'll post a link. Thanks

    Current result

    Img

    Code to Replicate issue

    from easygoogletranslate import EasyGoogleTranslate
    koko="Бывший гендиректор обанкротившейся криптовалютной биржи FTX Бэнкман-Фрид потерял все свое состояние в $16 млрд. Это один из крупнейших в истории случаев утраты состояния, передает Блумберг. На пике бизнеса состояние предпринимателя оценивалось в $26 млрд."
    koko1="""Если разрешите кину ссылку.
    Спасибо"""
    translator=EasyGoogleTranslate()
    print(koko)
    print(koko1)
    
    def tr(text):
        result = translator.translate(f'{(text)}', target_language='en')
        return result
    
    mk=tr(koko)
    kk=tr(koko1)
    print(mk)
    print(kk)
    
    
    opened by ahmadkarimi4 2
  • add option to detect a language

    add option to detect a language

    i wanna achieve something like this :

    Input text: "ру́сский язы́к" Output text: "Russian"

    Input text: "中文" Output text: "Chinese"

    Input text: "にほんご" Output text: "Japanese"

    Input text: "العَرَبِيَّة" Output text: "Arabic"

    using google api can we detect the lang ? if yes please add it to module

    opened by cheemzboi 1
Owner
Ahmet Eren Odacı
software engineer
Ahmet Eren Odacı
A simple language translator with python and google translate api

Language translator with python A simple language translator with python and google translate api Install pip and python 3.9. All the required depende

null 0 Nov 11, 2021
🔍 Google Search unofficial API for Python with no external dependencies

Python Google Search API Unofficial Google Search API for Python. It uses web scraping in the background and is compatible with both Python 2 and 3. W

Avi Aryan 204 Dec 28, 2022
A Simple Google Translate Bot By VndGroup ❤️ Made With Python

VndGroup Google Translator Heroku Deploy ❤️ Functions This Bot Can Translate 95 Languages We Can Set Custom Language Group Support Mandatory Vars [+]

Venuja Sadew 1 Oct 9, 2022
Telegram Google Translater Bot Can Translate Any Language To Your Selected Language

?? TELEGRAM GOOGLE TRANSLATER ?? • ⚡ INSTALLING ⚡ • • ✅ OFFICIAL SUPPORTS ✅ •

⚝ANKIT KUMAR⚝ 2 Jan 16, 2022
An API wrapper for Henrik's Unofficial VALORANT API

ValorantAPI.py An API wrapper for Henrik's Unofficial VALORANT API Warning!! This project is still in beta and only contains barely anything yet. If y

Jakkaphat Chalermphanaphan 0 Feb 4, 2022
This package accesses nitrotype's official api along with its unofficial user api

NitrotypePy This package accesses nitrotype's official api along with its unofficial user api. Currently still in development. Install To install, run

The Moon That Rises 2 Sep 4, 2022
Free and Open Source Machine Translation API. 100% self-hosted, no limits, no ties to proprietary services. Built on top of Argos Translate.

LibreTranslate Try it online! | API Docs Free and Open Source Machine Translation API, entirely self-hosted. Unlike other APIs, it doesn't rely on pro

UAV4GEO 3.5k Jan 3, 2023
First Party data integration solution built for marketing teams to enable audience and conversion onboarding into Google Marketing products (Google Ads, Campaign Manager, Google Analytics).

Megalista Sample integration code for onboarding offline/CRM data from BigQuery as custom audiences or offline conversions in Google Ads, Google Analy

Google 76 Dec 29, 2022
An unofficial client library for Google Music.

gmusicapi: an unofficial API for Google Play Music gmusicapi allows control of Google Music with Python. from gmusicapi import Mobileclient api = Mob

Simon Weber 2.5k Dec 15, 2022
An unofficial client library for Google Music.

gmusicapi: an unofficial API for Google Play Music gmusicapi allows control of Google Music with Python. from gmusicapi import Mobileclient api = Mob

Simon Weber 2.5k Dec 15, 2022