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.4
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
File details
Details for the file google-cloud-translate-1.3.3.tar.gz
.
File metadata
- Download URL: google-cloud-translate-1.3.3.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f204a1cc95bcd708102ad86665da2dff53c1b9f47d490506e45cc96c93978ad |
|
MD5 | 5b3abc9d000038feb38e47179586dbfd |
|
BLAKE2b-256 | dfabc9775fad6c2b757f08fce886d107e02a3915b2d33e1d93e3ef27fd55ad27 |
Provenance
File details
Details for the file google_cloud_translate-1.3.3-py2.py3-none-any.whl
.
File metadata
- Download URL: google_cloud_translate-1.3.3-py2.py3-none-any.whl
- Upload date:
- Size: 13.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a52fe0c61d04c8343eeae06efa8ddfca248a49a8a1df39a77c68253798ee0bd |
|
MD5 | 4485c6f4488a687be70521912e84073a |
|
BLAKE2b-256 | 9b777007bf1ee38c98337cbf4e6cf5f619fb12b384cf7fb9503f4021911a7547 |