# BookerTrans
用于 iBooker/ApacheCN 翻译项目的 HTML 谷歌翻译工具
## 安装
通过pip(推荐):
```
pip install BookerTrans
```
从源码安装:
```
pip install git+https://github.com/apachecn/BookerTrans
```
部分 API 依赖 Selenium 和 Chrome。请确保安装了 Chrome,并将其[驱动](http://npm.taobao.org/mirrors/chromedriver/)放到`PATH`下。
## 使用说明
```
btrans [-h] [-v] [-H HOST] [-P PROXY] [-t TIMEOUT] [-w WAIT_SEC]
[-r RETRY] [-s SRC] [-d DST]
site fname
-H HOST: 域名,默认为 translate.google.com
-P PROXY: 代理,格式为 \d+\.\d+\.\d+\.\d+:\d+,默认为空
-t TIMEOUT: 超时时间,以秒为单位,默认为 8
-w WAIT_SEC: 两次翻译之间的延迟(以秒为单位),默认为 0.5
-r RETRY: 重试次数,默认为 10
-s SRC: 源语言,默认为 auto
-d DST: 目标语言,默认为 zh-CN
site: API 名称,可选项为 {google,google_selenium,baidu,sogou,youdao}
fname: HTML 文件名称,或者文件所在的目录名称
```
## 协议
本项目基于 SATA 协议发布。
您有义务为此开源项目点赞,并考虑额外给予作者适当的奖励。
## 赞助我们
![](https://home.apachecn.org/img/about/donate.jpg)
## 另见
+ [ApacheCN 学习资源](https://docs.apachecn.org/)
+ [计算机电子书](http://it-ebooks.flygon.net)
+ [布客新知](http://flygon.net/ixinzhi/)
Raw data
{
"_id": null,
"home_page": "https://github.com/apachecn/BookerTrans",
"name": "BookerTrans",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "google,html,translate,translater,\u8c37\u6b4c,\u7ffb\u8bd1",
"author": "ApacheCN",
"author_email": "apachecn@163.com",
"download_url": "https://files.pythonhosted.org/packages/45/0a/fdb21b95834ed750ec7c2efbb3080c5db15c21c39a5dbad48ab7b40c6ca0/BookerTrans-2023.2.21.8.tar.gz",
"platform": null,
"description": "# BookerTrans\n\n\u7528\u4e8e iBooker/ApacheCN \u7ffb\u8bd1\u9879\u76ee\u7684 HTML \u8c37\u6b4c\u7ffb\u8bd1\u5de5\u5177\n\n## \u5b89\u88c5\n\n\u901a\u8fc7pip\uff08\u63a8\u8350\uff09\uff1a\n\n```\npip install BookerTrans\n```\n\n\u4ece\u6e90\u7801\u5b89\u88c5\uff1a\n\n```\npip install git+https://github.com/apachecn/BookerTrans\n```\n\n\u90e8\u5206 API \u4f9d\u8d56 Selenium \u548c Chrome\u3002\u8bf7\u786e\u4fdd\u5b89\u88c5\u4e86 Chrome\uff0c\u5e76\u5c06\u5176[\u9a71\u52a8](http://npm.taobao.org/mirrors/chromedriver/)\u653e\u5230`PATH`\u4e0b\u3002\n\n## \u4f7f\u7528\u8bf4\u660e\n\n```\nbtrans [-h] [-v] [-H HOST] [-P PROXY] [-t TIMEOUT] [-w WAIT_SEC] \n [-r RETRY] [-s SRC] [-d DST]\n site fname\n\n-H HOST: \u57df\u540d\uff0c\u9ed8\u8ba4\u4e3a translate.google.com\n-P PROXY: \u4ee3\u7406\uff0c\u683c\u5f0f\u4e3a \\d+\\.\\d+\\.\\d+\\.\\d+:\\d+\uff0c\u9ed8\u8ba4\u4e3a\u7a7a\n-t TIMEOUT: \u8d85\u65f6\u65f6\u95f4\uff0c\u4ee5\u79d2\u4e3a\u5355\u4f4d\uff0c\u9ed8\u8ba4\u4e3a 8\n-w WAIT_SEC: \u4e24\u6b21\u7ffb\u8bd1\u4e4b\u95f4\u7684\u5ef6\u8fdf\uff08\u4ee5\u79d2\u4e3a\u5355\u4f4d\uff09\uff0c\u9ed8\u8ba4\u4e3a 0.5\n-r RETRY: \u91cd\u8bd5\u6b21\u6570\uff0c\u9ed8\u8ba4\u4e3a 10\n-s SRC: \u6e90\u8bed\u8a00\uff0c\u9ed8\u8ba4\u4e3a auto\n-d DST: \u76ee\u6807\u8bed\u8a00\uff0c\u9ed8\u8ba4\u4e3a zh-CN\nsite: API \u540d\u79f0\uff0c\u53ef\u9009\u9879\u4e3a {google,google_selenium,baidu,sogou,youdao}\nfname: HTML \u6587\u4ef6\u540d\u79f0\uff0c\u6216\u8005\u6587\u4ef6\u6240\u5728\u7684\u76ee\u5f55\u540d\u79f0\n```\n\n## \u534f\u8bae\n\n\u672c\u9879\u76ee\u57fa\u4e8e SATA \u534f\u8bae\u53d1\u5e03\u3002\n\n\u60a8\u6709\u4e49\u52a1\u4e3a\u6b64\u5f00\u6e90\u9879\u76ee\u70b9\u8d5e\uff0c\u5e76\u8003\u8651\u989d\u5916\u7ed9\u4e88\u4f5c\u8005\u9002\u5f53\u7684\u5956\u52b1\u3002\n\n## \u8d5e\u52a9\u6211\u4eec\n\n![](https://home.apachecn.org/img/about/donate.jpg)\n\n## \u53e6\u89c1\n\n+ [ApacheCN \u5b66\u4e60\u8d44\u6e90](https://docs.apachecn.org/)\n+ [\u8ba1\u7b97\u673a\u7535\u5b50\u4e66](http://it-ebooks.flygon.net)\n+ [\u5e03\u5ba2\u65b0\u77e5](http://flygon.net/ixinzhi/)\n\n\n",
"bugtrack_url": null,
"license": "",
"summary": "HTML Translator with Google Api for iBooker/ApacheCN",
"version": "2023.2.21.8",
"split_keywords": [
"google",
"html",
"translate",
"translater",
"\u8c37\u6b4c",
"\u7ffb\u8bd1"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7eb5094fefa7361f729a6212d53a7572338e1bf8ab712d8b2d2a50433c2d169a",
"md5": "777c195a40556b20e394d49d332ea0dc",
"sha256": "8e4f77a51b60a1c51eae6801ad5dfc6674ba1d4659cd6eb3945e614fbcb59449"
},
"downloads": -1,
"filename": "BookerTrans-2023.2.21.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "777c195a40556b20e394d49d332ea0dc",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 29175,
"upload_time": "2023-03-10T08:18:42",
"upload_time_iso_8601": "2023-03-10T08:18:42.101584Z",
"url": "https://files.pythonhosted.org/packages/7e/b5/094fefa7361f729a6212d53a7572338e1bf8ab712d8b2d2a50433c2d169a/BookerTrans-2023.2.21.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "450afdb21b95834ed750ec7c2efbb3080c5db15c21c39a5dbad48ab7b40c6ca0",
"md5": "2a39dff39c08137bcf243dd9b35e969a",
"sha256": "bea44363d7eefd7b834a95838ded840841ce6162dcaf4266300b00b6cb66d60b"
},
"downloads": -1,
"filename": "BookerTrans-2023.2.21.8.tar.gz",
"has_sig": false,
"md5_digest": "2a39dff39c08137bcf243dd9b35e969a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 22914,
"upload_time": "2023-03-10T08:18:43",
"upload_time_iso_8601": "2023-03-10T08:18:43.702505Z",
"url": "https://files.pythonhosted.org/packages/45/0a/fdb21b95834ed750ec7c2efbb3080c5db15c21c39a5dbad48ab7b40c6ca0/BookerTrans-2023.2.21.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-10 08:18:43",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "apachecn",
"github_project": "BookerTrans",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "bookertrans"
}