Google Cloud Translation API client library
Project description
With Google Cloud Translation, you can dynamically translate text between thousands of language pairs. The Google Cloud Translation API lets websites and programs integrate with Google Cloud Translation programmatically. Google Cloud Translation is available as a paid service. See the Pricing and FAQ pages for details.
Quick Start
In order to use this library, you first need to go through the following steps:
Installation
Install this library in a virtualenv using pip. virtualenv is a tool to create isolated Python environments. The basic problem it addresses is one of dependencies and versions, and indirectly permissions.
With virtualenv, it’s possible to install this library without needing system install permissions, and without clashing with the installed system dependencies.
Supported Python Versions
Python >= 3.5
Deprecated Python Versions
Python == 2.7. Python 2.7 support will be removed on January 1, 2020.
Mac/Linux
pip install virtualenv
virtualenv <your-env>
source <your-env>/bin/activate
<your-env>/bin/pip install google-cloud-translate
Windows
pip install virtualenv
virtualenv <your-env>
<your-env>\Scripts\activate
<your-env>\Scripts\pip.exe install google-cloud-translate
Example Usage
>>> from google.cloud import translate
>>> client = translate.Client()
>>> client.get_languages()
[
{
'language': 'af',
'name': 'Afrikaans',
},
...
]
>>> client.detect_language(['Me llamo', 'I am'])
[
{
'confidence': 0.25830904,
'input': 'Me llamo',
'language': 'es',
}, {
'confidence': 0.17112699,
'input': 'I am',
'language': 'en',
},
]
>>> from google.cloud import translate
>>> client = translate.Client()
>>> client.translate('koszula')
{
'translatedText': 'shirt',
'detectedSourceLanguage': 'pl',
'input': 'koszula',
}
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
Hashes for google-cloud-translate-1.5.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68b8bc0a4ab40009e817557c5acab26ab2e355ce11d170bf89a5d0452e0d08b9 |
|
MD5 | d65e34171024bfb5358e5db9e079de67 |
|
BLAKE2b-256 | ee94a824daf130de671bfc66a54754fa90e600185adae0f77ffaeb719d5ad20c |
Hashes for google_cloud_translate-1.5.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1ec7549a5834bef9c1300f0827c3249690fd1a0ff8c4e5477433b8d1274ec10 |
|
MD5 | a560028a1ea10b6adb61bbadd4a542e1 |
|
BLAKE2b-256 | d0028c4ceb4a16c025625d525d64aefea737955130c5d91db34e6a08b8bd3cd3 |