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

Metadata

Release files for google-tr-async-free 0.0.2

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

Source distribution (sdist)

Source distribution for google-tr-async-free 0.0.2
File Size Uploaded
google-tr-async-free-0.0.2.tar.gz 4.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for google-tr-async-free 0.0.2
File Interpreter ABI Platform
google_tr_async_free-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 9.5 kB

Release files / google-tr-async-free-0.0.2.tar.gz

Download URL google-tr-async-free-0.0.2.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0431520127760a9d61ec9755e2aafb6ed32a451a202c9e93284beb1f3f8c5df5
BLAKE2b-256 checksum
How to use checksums
0ac0874a2ae674460acbca1c16138101a0cb8809dc7d85f075d6abccae88a856
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / google_tr_async_free-0.0.2-py3-none-any.whl

Download URL google_tr_async_free-0.0.2-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
060963b63e17bb042507fac59356efc84bb8e09ac7e4616d80cddb445f07900b
BLAKE2b-256 checksum
How to use checksums
077d0511a025380a278bd2a298e1e4a0764fb7fccf26049e2ceeab5638559601
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

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