Skip to main content

A library for interacting with the Google Translate API

Project description

A python library for interacting with the Google Translate API.

Note: This uses the translate v2 API

You will need a server key configured with Google, and a payment method on file, as there is no courtesy limit for translations.


See the [Google Translate docs]( for more details.

>>> from pyglot import Translator
>>> lang = Translator(key='YOUR-KEY')

# Translating text: >>> lang.translate(‘The quick brown fox jumped over the lazy dog’, target=’de’) GTranslation({u’translatedText’: u’Der schnelle braune Fuchs sprang xfcber den faulen Hund’, u’detectedSourceLanguage’: u’en’})

# Detecting the language of text: >>> lang.detect(‘The quick brown fox jumped over the lazy dog’) [GLanguage({u’isReliable’: False, u’confidence’: 0.79904306, u’language’: u’en’})]

# Getting a list of language codes, with names in english: >>> lang.languages(target=’en’) [GLanguage({u’name’: u’Afrikaans’, u’language’: u’af’}), GLanguage({u’name’: u’Albanian’, u’language’: u’sq’}), … ]

Project details

Download files

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

Files for pyglot, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size pyglot-0.1.1.tar.gz (2.4 kB) File type Source Python version None Upload date Hashes View
Filename, size pyglot-0.1.1.macosx-10.4-intel.tar.gz (3.8 kB) File type Dumb Binary Python version any Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page