Skip to main content

Google Cloud Translation API client library

Project description

GA pypi versions

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:

  1. Select or create a Cloud Platform project.

  2. Enable billing for your project.

  3. Enable the Google Cloud Translate API.

  4. Setup Authentication.

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


Download files

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

Source Distribution

google-cloud-translate-1.6.0.tar.gz (47.7 kB view details)

Uploaded Source

Built Distribution

google_cloud_translate-1.6.0-py2.py3-none-any.whl (48.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file google-cloud-translate-1.6.0.tar.gz.

File metadata

  • Download URL: google-cloud-translate-1.6.0.tar.gz
  • Upload date:
  • Size: 47.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.0

File hashes

Hashes for google-cloud-translate-1.6.0.tar.gz
Algorithm Hash digest
SHA256 6223ffdbbe8177d109e4682b15c88754cfbcce5ea8af79818014726c046db774
MD5 198a0d8db63c5336dcecc980f2737511
BLAKE2b-256 50160f79adea3ced1e0fd7261be518c6cc08a3f72e3b3ec6bdbe4a4d60bedf62

See more details on using hashes here.

Provenance

File details

Details for the file google_cloud_translate-1.6.0-py2.py3-none-any.whl.

File metadata

  • Download URL: google_cloud_translate-1.6.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 48.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.0

File hashes

Hashes for google_cloud_translate-1.6.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3dab9861528beb1a483db751d0d670cb944061761f07f35caf45d0363d40dbd3
MD5 a797c5a184953e5949c22c9f1a9d5da2
BLAKE2b-256 80eb7680fb6e38cd0382d3174f3e3a05f4eb32f18c34233f45d9daea28b970ea

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page