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.1.2.tar.gz
(14.0 kB
view details)
File details
Details for the file baidufanyi-0.1.2.tar.gz
.
File metadata
- Download URL: baidufanyi-0.1.2.tar.gz
- Upload date:
- Size: 14.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 281e0e2c0a0fe85af71b3816775e085f7a028767d980d72b9b82d2c9c098ac7e |
|
MD5 | 024d50228007ce57890dd845d5f3ff62 |
|
BLAKE2b-256 | 33df5668a55a5ba1eed88ce4e9c5db51587e972c23445ea36ce68b14f6fc9241 |