cloud-translator
Use the same api to call the third party translator apis, such as google, tencent, baidu.
Prerequisite
Python 3.7 or more latest version
Installation
pip install cloud-translator
Usage
The library support GoogleTranslator, TencentTranslator, BaiduTranslator, where GoogleTranslator depends on py-googletrans which not needs appid and appkey, but is not stable and probably blocked by google.
TencentTranslator and BaiduTranslator are rewritted with reference to the offical demo script to support python 3.7 version
from translator import *
# use google
translator = GoogleTranslator()
print(translator.translate('我是中国人', dest='en'))
# use baidu api
translator = BaiduTranslator(appid, appkey)
print(translator.translate('我是中国人', dest='en'))
# use tencent api
translator = TencentTranslator(appid, appkey)
print(translator.translate('我是中国人', dest='en'))
# throttle api call frequency.
translate_func = throttle(seconds=1)(translator.translate) # call api every second
for i in range(100):
translate_func('我是中国人', dest='en')
Metadata
Release files for cloud-translator 1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cloud-translator-1.0.tar.gz | 3.4 kB | Without provenance | Details for cloud-translator-1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cloud_translator-1.0-py3-none-any.whl | Python 3 | none | any | Details for cloud_translator-1.0-py3-none-any.whl |
Total release size: 7.6 kB
Release files / cloud-translator-1.0.tar.gz
| Download URL | cloud-translator-1.0.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9fcb8d58f32547793a21b9bcf0cfae4fe318f94467f1eddd2e75471ae8680d79
|
|
BLAKE2b-256 checksum How to use checksums |
4ab62ec44a602847c59731082db21809b946c81d619fabbdeb0b806cd0d4f0f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.1
|
Release files / cloud_translator-1.0-py3-none-any.whl
| Download URL | cloud_translator-1.0-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9b30991ace789bdbfff07d12699e2d78aea1ccb57168da0142d2a79b3980fcfc
|
|
BLAKE2b-256 checksum How to use checksums |
22d0880b128e9ce0c1c60e32c4706cfdcc6ec52fd8641339ed77280f6638c6b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.1
|
Security for cloud-translator 1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.