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-2.0.0.tar.gz (84.4 kB view details)

Uploaded Source

Built Distribution

google_cloud_translate-2.0.0-py2.py3-none-any.whl (90.8 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

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

File hashes

Hashes for google-cloud-translate-2.0.0.tar.gz
Algorithm Hash digest
SHA256 e5c66712950261a4d8bea4979d430a808ac0cee7efe284479b668a6c9130cc59
MD5 ae4b662cde045396e0c015c441d65ba9
BLAKE2b-256 2af7f214f025d4c6fd90f7e333ef14009064073711afe56645b6c3e5f09e5219

See more details on using hashes here.

Provenance

File details

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

File metadata

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

File hashes

Hashes for google_cloud_translate-2.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 85f3c4b4356a71fc3c847ff949b4927657189459c008f6f39e99686f81b4030f
MD5 ed8158fbb9e5f6ec7235a67f48493127
BLAKE2b-256 a873bedb7509c851957f578d135e3a11e0c347219c46e6fee6126be8204bb68e

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