Skip to main content

google-tr-async-free

Python3637 packagecodecovhttpxPyPI versionstatus

Google translate for free -- based on httpx with proxy support. Let's hope it lasts.

Installation

pip install google-tr-async-free

or

  • Install (pip or whatever) necessary requirements, e.g. pip install httpx js2py loguru or pip install -r requirements.txt
  • Drop the file google_tr.py in any folder in your PYTHONPATH (check with import sys; print(sys.path)
  • or clone the repo (e.g., git clone https://github.com/ffreemt/google-tr-async-free.git or download https://github.com/ffreemt/google-tr-async-free/archive/master.zip and unzip) and change to the google-tr-free folder and do a python setup.py develop

Usage

import asyncio
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
arun = lambda x: loop.run_until_complete(x)

from google_tr_async import google_tr_async

_ = [google_tr_async('hello world'),
  google_tr_async('hello world', to_lang='de'),
  google_tr_async('hello world', to_lang='fr'),
  google_tr_async('hello world', to_lang='ja')]
res = arun(asyncio.gather(*_))

print(res[0])  # ->'你好,世界'
print(res[1])  # ->'Hallo Welt'
print(res[2])  # ->'Bonjour le monde'
print(res[3])  # ->'こんにちは世界'

Acknowledgments

  • Thanks to everyone whose code was used

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

google-tr-async-free-0.0.2.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

google_tr_async_free-0.0.2-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file google-tr-async-free-0.0.2.tar.gz.

File metadata

  • Download URL: google-tr-async-free-0.0.2.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.6

File hashes

Hashes for google-tr-async-free-0.0.2.tar.gz
Algorithm Hash digest
SHA256 0431520127760a9d61ec9755e2aafb6ed32a451a202c9e93284beb1f3f8c5df5
MD5 9c952b070ce497cb76ca1ffd3d819c10
BLAKE2b-256 0ac0874a2ae674460acbca1c16138101a0cb8809dc7d85f075d6abccae88a856

See more details on using hashes here.

File details

Details for the file google_tr_async_free-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: google_tr_async_free-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.6

File hashes

Hashes for google_tr_async_free-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 060963b63e17bb042507fac59356efc84bb8e09ac7e4616d80cddb445f07900b
MD5 428f138dbd93a34137866688c1c90030
BLAKE2b-256 077d0511a025380a278bd2a298e1e4a0764fb7fccf26049e2ceeab5638559601

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 files

0.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page