baidu translate for free
Baidu translate for free -- local cache plus throttling. Let's hope it lasts.
pip install -U baidu-tr-free
- install (pip or whatever) necessary requirements, e.g.
pip install js2py requests_cache jsonpath_rwor
pip install -r requirements.txt
- Drop the file bdtr.py in any folder in your PYTHONPATH (check with import sys; print(sys.path)
- Several valid TOKEN/BAIDUID are included.
- or clone the repo (e.g.,
git clone https://github.com/ffreemt/baidu-tr-free.gitor download https://github.com/ffreemt/baidu-tr-free/archive/master.zip and unzip) and change to the baidu-tr-free folder and do a
python setup.py develop
from bdtr import bdtr print(bdtr('hello world')) # -> '你好，世界' print(bdtr('hello world', to_lang='de')) # ->'Hallo Welt' print(bdtr('hello world', to_lang='jp')) # ->'ハローワールド'
Validation and Pressure Tests
- pip install pytest
- Average delay for throttling set to 0.6 s, ajdust as needed
- Thanks to everyone whose code was used
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size baidu-tr-free-0.0.4.tar.gz (7.5 kB)||File type Source||Python version None||Upload date||Hashes View hashes|