Skip to main content

Google Translate Client with `deep-translator`

Project description

Google Translate Client with deep-translator

Install

python3 -m pip install googletranslate-python

Usage

Python

from googletranslatepy import Translator

# use a http proxies
translator = Translator(proxies='http://127.0.0.1:10809')

# use a socks5 proxies
translator = Translator(proxies='socks5://127.0.0.1:10808')

translator.translate('Life is short, you need Python!')
# '人生苦短,你需要 Python!'

CMD

googletranslate --help

# list all available languages
googletranslate -l
# {
#  "afrikaans": "af",
#  "albanian": "sq",
#  "amharic": "am",
#  "arabic": "ar",
# ...

# translate a string text
googletranslate -p http://127.0.0.1:10809 'Life is short, you need Python!'

# translate a file
googletranslate -p http://127.0.0.1:10809 README.md

# set proxies to env
GOOGLE_PROXIES=http://127.0.0.1:10809 googletranslate 'hello world'

# or add to: ~/.bash_profile
export GOOGLE_PROXIES=http://127.0.0.1:10809
# and then use it directly
googletranslate 'hello world'

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

googletranslate-python-1.0.2.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

googletranslate_python-1.0.2-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file googletranslate-python-1.0.2.tar.gz.

File metadata

File hashes

Hashes for googletranslate-python-1.0.2.tar.gz
Algorithm Hash digest
SHA256 1d8c8aecf93d24bdd6b50b64800994bcca68412be79d9e06fa809745b708f24a
MD5 39ac44de3e318981b0b3bac274445183
BLAKE2b-256 af405d1a84851874bc491513a6a051de8d17fdea7df618ac2654425acb4ddda7

See more details on using hashes here.

File details

Details for the file googletranslate_python-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for googletranslate_python-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6dc0c2b8ce011c516e685b43b9687e73f19d63aa223a98856889a8ef183570c6
MD5 3e77635376dc14e5e01291122a504591
BLAKE2b-256 7febd9c87b6e33ba4dc217dd41c20fa80da769906e444409d1b10572f2e44cb7

See more details on using hashes here.

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