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.2.3.tar.gz (14.6 kB view details)

Uploaded Source

File details

Details for the file baidufanyi-0.2.3.tar.gz.

File metadata

  • Download URL: baidufanyi-0.2.3.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

Hashes for baidufanyi-0.2.3.tar.gz
Algorithm Hash digest
SHA256 fcf54085d7a56dbfbe4cb601e7601115797de67d0bf9bd464c5966d14037b4f7
MD5 73339a8a282548ccfb0bc925f1c4e37e
BLAKE2b-256 cc9e6bf0dae7b65d4081326245b9a23e85d3397cf8caa660229a539644d67928

See more details on using hashes here.

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