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.

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


Release history Release notifications | RSS feed

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

google_cloud_translate-1.3.2-py2.py3-none-any.whl (12.9 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: google-cloud-translate-1.3.2.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3

File hashes

Hashes for google-cloud-translate-1.3.2.tar.gz
Algorithm Hash digest
SHA256 bd0cd1a7551c80a81a0988f29d27edcb2bce751b50a520ba45b3d1795772eaf8
MD5 6336eb267910737fb02bd0ac0bddee67
BLAKE2b-256 f03422a6ada7c81ebd68041c9fef3c51e663a2f8ee089451de113b50998962b6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: google_cloud_translate-1.3.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3

File hashes

Hashes for google_cloud_translate-1.3.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a4cb2cb4b498ef12a17ea82706189033be3f31b983c13926a8ed2cbd2daa3144
MD5 366a63179de1adc3482f6d7aff1f7bfb
BLAKE2b-256 638cc1bf759d0eaf3424e9f4e6cc6e01ad88a3836be2b1987d8666afb5638189

See more details on using hashes here.

Supported by

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