A simple SDK for the Baidu Translation API (unofficial)
Project description
Baidu Fanyi
Description
A simple SDK for the Baidu Translation API (unofficial)
一个简单的用于调用百度翻译api的包。
Install
pip3 install baidufanyi
Usage
from baidufanyi import BaiduFanyi # 注意大小写
APPID = "your appid"
APPKEY = "your appkey"
# APPID 与 APPKEY 可在百度翻译开放平台获取,标准版可免费使用
fanyi = BaiduFanyi(APPID, APPKEY)
print(fanyi.translate("hello world", fromLang="auto", toLang="zh"))
# fromLang 和 toLang 格式请查阅百度翻译api文档
Features
-
支持多行,自动合并
-
简单易用,立即上手
-
支持多种语言的设置
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
baidufanyi-0.2.1.tar.gz
(14.6 kB
view details)
File details
Details for the file baidufanyi-0.2.1.tar.gz
.
File metadata
- Download URL: baidufanyi-0.2.1.tar.gz
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c07cc987a17decf9acfc1f93a879daf84cdec19209bc4d23d0a74d8b3e37df06 |
|
MD5 | 3a2f7722dea5182803181b81d5142764 |
|
BLAKE2b-256 | 15341fa464e3881ffa60b92ef01e943df4ce36b542999a3c16c93a27e9dd2ed7 |