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.5.tar.gz
(14.6 kB
view details)
File details
Details for the file baidufanyi-0.2.5.tar.gz
.
File metadata
- Download URL: baidufanyi-0.2.5.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 | 36b906a48bc7cec2f0492d11813a45e9d4cf8a2bfea36921f058b9b75ee6b55b |
|
MD5 | 8fcd78c8ed38ff8535220ac245a034ea |
|
BLAKE2b-256 | ce354cf11b74c0be2724575f5992ba8a208d0d72fd0f6e9d325340b959afa624 |