google trnaslate async for free
Project description
google-tr-async-free
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
orpip 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 apython 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for google-tr-async-free-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0431520127760a9d61ec9755e2aafb6ed32a451a202c9e93284beb1f3f8c5df5 |
|
MD5 | 9c952b070ce497cb76ca1ffd3d819c10 |
|
BLAKE2b-256 | 0ac0874a2ae674460acbca1c16138101a0cb8809dc7d85f075d6abccae88a856 |
Close
Hashes for google_tr_async_free-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 060963b63e17bb042507fac59356efc84bb8e09ac7e4616d80cddb445f07900b |
|
MD5 | 428f138dbd93a34137866688c1c90030 |
|
BLAKE2b-256 | 077d0511a025380a278bd2a298e1e4a0764fb7fccf26049e2ceeab5638559601 |