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

Uploaded Source

Built Distribution

google_cloud_translate-1.7.2-py2.py3-none-any.whl (91.0 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

File hashes

Hashes for google-cloud-translate-1.7.2.tar.gz
Algorithm Hash digest
SHA256 bf323bc02eb9b14ef0e12cd1bcbeb25868911a1522725e8c2dca3f2705ca6005
MD5 ace648ef0a8728fa7e2c81ef3f8e577e
BLAKE2b-256 1d87959f1cb6a313c4e36bf322c1eaf98ac3d6467bb1958a00078888b1d07e4a

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for google_cloud_translate-1.7.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5c6787a239f57f0ea6cd111a8918023a53dba00c41922fa81676a85520443b5b
MD5 a7ae6406047955afd3cfcdccd609adb6
BLAKE2b-256 73c23c0198a68bbcc201b82fa7fc278c89f539bc1636cb5e0b04b606f830bac8

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