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.3.0.tar.gz
(14.7 kB
view details)
File details
Details for the file baidufanyi-0.3.0.tar.gz.
File metadata
- Download URL: baidufanyi-0.3.0.tar.gz
- Upload date:
- Size: 14.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cff141b65b3bebdf7fd196bc15d1d51b5e9ae913ed777f24bf0f3088f60b4a4e
|
|
| MD5 |
de34e2e8720345d9bbf582651ebcbcd1
|
|
| BLAKE2b-256 |
9c01f1e6a9c99a39f329e7ce1c546735e583d2945e740f51cc029dc8860c5d84
|