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

Uploaded Source

Built Distribution

google_cloud_translate-1.5.0-py2.py3-none-any.whl (47.9 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: google-cloud-translate-1.5.0.tar.gz
  • Upload date:
  • Size: 44.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.1 CPython/3.6.0

File hashes

Hashes for google-cloud-translate-1.5.0.tar.gz
Algorithm Hash digest
SHA256 68b8bc0a4ab40009e817557c5acab26ab2e355ce11d170bf89a5d0452e0d08b9
MD5 d65e34171024bfb5358e5db9e079de67
BLAKE2b-256 ee94a824daf130de671bfc66a54754fa90e600185adae0f77ffaeb719d5ad20c

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: google_cloud_translate-1.5.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 47.9 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.1 CPython/3.6.0

File hashes

Hashes for google_cloud_translate-1.5.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c1ec7549a5834bef9c1300f0827c3249690fd1a0ff8c4e5477433b8d1274ec10
MD5 a560028a1ea10b6adb61bbadd4a542e1
BLAKE2b-256 d0028c4ceb4a16c025625d525d64aefea737955130c5d91db34e6a08b8bd3cd3

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