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.
Usage:
See the [Google Translate docs](https://developers.google.com/translate/v2/using_rest) 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
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
Built Distribution
File details
Details for the file pyglot-0.1.1.tar.gz
.
File metadata
- Download URL: pyglot-0.1.1.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8bcc3bf7d6401d90ce8e4f804ba6dbb3422715f7c4727df420ae3d87f5995a44 |
|
MD5 | 29bb0b0b0a9cdf19ffc592c52f4037f6 |
|
BLAKE2b-256 | 701db338bd6227f8b2c81abe14e32df2edcd7445395533e7ef5a45fbbbd7215f |
File details
Details for the file pyglot-0.1.1.macosx-10.4-intel.tar.gz
.
File metadata
- Download URL: pyglot-0.1.1.macosx-10.4-intel.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 680684eb87070af60fa82fcac62a61ea0d243c56b3bfe348cac6432d6e30861a |
|
MD5 | ed404dbc5244fe3565b19ac754a9e514 |
|
BLAKE2b-256 | 4d9f6df5ddebcdc71d5dd93b0abb74d07b1e51a2c85b770d4c9d2c8aed5e62ff |