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

Uploaded Source

Built Distribution

google_cloud_translate-1.7.0-py2.py3-none-any.whl (90.9 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: google-cloud-translate-1.7.0.tar.gz
  • Upload date:
  • Size: 84.2 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-1.7.0.tar.gz
Algorithm Hash digest
SHA256 55b6563121883acce5d80afbf61a59e50d52c429e6ebbfe81a1c8f2734b75e8c
MD5 43eb541a51fbcec8335818cb6518e8a2
BLAKE2b-256 0e9e106cc7aa198f0537177a5e6bc0d07f3fc478b68aa0038af1a6925240a46f

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: google_cloud_translate-1.7.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 90.9 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-1.7.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 302af77bc18fc56fe4a83aad835cf54609d4e188dd6bd7b35ffcb3f303459705
MD5 a51518acf718dc7074ef179d5dfc56a6
BLAKE2b-256 8bc52a04613d16a1858726777e6838c39eebf298f8384dce7520c0184d169209

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