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.

>>> import pygtaw
>>> api_key = 'ENTER_API_KEY'
>>> client = pygtaw.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.9

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.9
File Size Uploaded Provenance Actions
pygtaw-0.0.9.tar.gz 3.3 kB Without provenance Details for pygtaw-0.0.9.tar.gz

Release files / pygtaw-0.0.9.tar.gz

Download URL pygtaw-0.0.9.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d354d7fe0146f4fa8f5a80ce324148499b4c5588c8ed40e6a7eb64d1bce41ba9
BLAKE2b-256 checksum
How to use checksums
421a7876ded6bcc0ebfe41989ab11f638fc8428c1f0dadf97d27fffc43080c94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for pygtaw 0.0.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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