sure-trans
Wrap translators with tenacity, auto-adapt
Install it
pip install sure-trans
# pip install git+https://github.com/ffreemt/sure-trans
# poetry add git+https://github.com/ffreemt/sure-trans
# git clone https://github.com/ffreemt/sure-trans && cd sure-trans
Use it
from sure_trans import sure_trans
print(sure_trans("书山有路勤为径", from_language="zh", to_language="en"))
# api used: iciba_api, took 4.57s
# only the diligent will be rewarded by God in their pursuit for knowledge
print(sure_trans("书ä¸è‡ªæœ‰é»„金屋", from_language="zh", to_language="en"))
# api used: caiyun_api, took 1.32s
# The book has its own house of gold