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

Uploaded Source

Built Distribution

google_cloud_translate-1.7.1-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.1.tar.gz.

File metadata

File hashes

Hashes for google-cloud-translate-1.7.1.tar.gz
Algorithm Hash digest
SHA256 8296a87767ca01251666580aa0d5a5a9a2968b74d90e01ab3901c224bb261433
MD5 2959770ced2367d20fdbaed21e704587
BLAKE2b-256 34fd2724d1c9d1c2b76e6bc288708c37184de5f8cc813e93010eca5d324d25b7

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for google_cloud_translate-1.7.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ce9f63177d7a3d0ef76d3cbfa4e6394b75be3a7cb2f68ffe98ac33c757f7ced5
MD5 997d3a540538748a6718b02e59db8d2b
BLAKE2b-256 e9691f4eae44b159b695acde8850fc574b61b4c431d3a951f91c066ad56102fe

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