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

Uploaded Source

Built Distribution

google_cloud_translate-1.4.1-py2.py3-none-any.whl (52.2 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: google-cloud-translate-1.4.1.tar.gz
  • Upload date:
  • Size: 56.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.14

File hashes

Hashes for google-cloud-translate-1.4.1.tar.gz
Algorithm Hash digest
SHA256 c48efab9c0ff4714fe56f372edd8324867afc72dd9baf0c0e0e22d0c3cdd1333
MD5 1e13c7caae062576d19ba636dd6fdecd
BLAKE2b-256 b2dd10f10112d2b8cade0dbcf2f6b2e9857cc6d23c84ab9f452af9751bd766a7

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: google_cloud_translate-1.4.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 52.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.14

File hashes

Hashes for google_cloud_translate-1.4.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 429e4acac14f6c6a693644d2df6ac14c622dfe1098538688d9b0d818787ec906
MD5 21e8c086fb18f1b4a17f0aa519d7051c
BLAKE2b-256 b0a47db919c8c08e65b56db07e6cbaa3d4ee1973743c2bfb5859a2c2e34c9a76

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