快速上手
# 导入翻译类
from mt_engines import MTTranslator
# 初始化翻译引擎
'''
translator = MTTranslator('Google')
translator = MTTranslator('Deepl', key='***')
translator = MTTranslator('Tencent', id='***', key='***', region='***')
'''
translator = MTTranslator('Google')
# 查看翻译引擎支持的语种名称
translator.support_languages
# 单个文本翻译
result = translator.translate('待翻文本','zh-CN','en')
# 多个待翻译文本
result = translator.pool_translate(['待翻文本1','待翻文本2','待翻文本3'],'zh-CN','en')
# 导入待翻译文件
translator.load_file('翻译表.xlsx')
# 翻译加载的文件,第3个参数为元组,输入待翻译文件的起始行,终止行,原文列,译文列
translator.translate_file('zh-CN','en',(1,'auto',1,2))
# 启用均衡算法进行批量机翻
result = translator.compress_translate( ['待翻文本1','待翻文本2','待翻文本3'], 'zh-CN', 'en', thread_num=3, max_words=2000)
# 在文件翻译中启用均衡算法
result = translator.translate_file('zh-CN','en',(1,'auto',1,2),compress=True)
Metadata
Release files for mt-engines 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mt_engines-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for mt_engines-2.0.0-py3-none-any.whl |
Release files / mt_engines-2.0.0-py3-none-any.whl
| Download URL | mt_engines-2.0.0-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a0dbccf6e5148f2b8344adc8d0e8556fc309b7fd8949cf97f7998dfeae02a2d3
|
|
BLAKE2b-256 checksum How to use checksums |
8a68e531c6329bd55cf44cc6a112844bdb8135cd9773231b23d59b5e0a1e9a55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Security for mt-engines 2.0.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.