Google translate free and unlimited, itranslate since gtranslate is taken
Project description
itranslate
Google translate free and unlimited access, itranslate
because gtranslate is taken
Install it
pip install itranslate
# or pip install git+https://github.com/ffreemt/google-itranslate
# or use poetry
# poetry add itranslate
# poetry add git+https://github.com/ffreemt/google-itranslate
Use it
The quality from this service is not as good as web google translate. There is nothing we can do about it.
It's unclear whether your ip will be blocked if you relentlessly use the service. Please feedback should you find out any information.
from itranslate import itranslate as itrans
itrans("test this and that") # '测试这一点'
# new lines are preserved
itrans("test this \n\nand that") # '测试这一点\n\n然后'
itrans("test this and that", to_lang="de") # 'Testen Sie das und das'
itrans("test this and that", to_lang="ja") # 'これとそれをテストします'
async version
: atranslate
If you feel so inclined, you may use the async version of itranslate: atranslate:
import asyncio
from itranslate import atranslate as atrans
texts = ["test this", "test that"]
coros = [atrans(elm) for elm in texts]
loop = asyncio.get_event_loop()
trtexts = loop.run_until_complete(asyncio.gather(*coros))
print(trtexts)
# ['测试这一点', '测试']
Proxies support
itrans("test this and that", proxies="http://localhost:8030")
or
proxies = {
"http://": "http://localhost:8030",
"https://": "http://localhost:8031",
}
itrans("test this and that\n another test", proxies=proxies)
Check https://www.python-httpx.org/advanced/ for other ways of setting up proxies.
Disclaimer
itranslate
is for study and research purpose only. The interface used by itranslate
may become invalid without notice and render itranslate
completely useless.
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
Hashes for itranslate-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13b2599982493ea0569cef1bd79c0de6ae2451219821fc087e6aebc4b02b4777 |
|
MD5 | 5d75a62f084a22f19bd15093fe4f7d77 |
|
BLAKE2b-256 | b2630b2fa2bfadb8e153f141c06c0b97476e7daa10459044bbd1c30b55d11b3c |