Skip to main content

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

  1. 支持多行,自动合并

  2. 简单易用,立即上手

  3. 支持多种语言的设置

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 hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page