Skip to main content

pygtaw

A tiny Google Translate API wrapper written in Python. An API key is needed to use this. More information on obtaining the API key can be found on the Google Translate API site.

The full list of supported languages.

Usage

To install: pip install pygtaw.

Identify your api key and make a new Client object.

>>> from pygtaw import wrapper
>>> api_key = 'ENTER_API_KEY'
>>> client = wrapper.Client(api_key)

To make the translation request:

>>> query = 'Hello, world!'
>>> target = 'Korean'
>>> source = 'English'
>>> translation = client.translate(query, target, source)
>>>
>>> print translation.translated_text
안녕하세요

You can send a translation request without a source as well–the Google Translate API can detect the source language:

>>> translation = client.translate('Hello', target='Spanish')
>>> print translation.translated_text
Hola
>>> print translation.detected_source_language
English

Tests

Currently, tests are made by making requests to Google Translate API. To run the tests, make a key file in the tests folder and make sure it’s added to .gitignore.

Metadata

Release files for pygtaw 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pygtaw 0.0.5
File Size Uploaded
pygtaw-0.0.5.tar.gz 3.2 kB Details

Release files / pygtaw-0.0.5.tar.gz

Download URL pygtaw-0.0.5.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5e1d142ee61cd684708fdfb9689329c4a4682b6da40d62c81493a534d88d4e31
BLAKE2b-256 checksum
How to use checksums
593f0d344a354b03ba1bb25c73ecc8ae65ff5bc14ccf432044250c3708058f13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

This release

0.0.5 This release

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page