Skip to main content

This is a simple, yet powerful command line translator with baidu translate

Project description

# query
This is a simple, yet powerful command line translator with baidu translate
命令行下翻译工具,翻译服务基于百度翻译

https://github.com/yangyang-zhang/query
## install 安装
pip install query-cli

## Usage 用法

### English To Chinese(英文翻译中文)
```
query apple
*****************************
*apple:苹果
*****************************

```

### Chinese To English(中文翻译英文)

```
query -t en 苹果
*****************************
*苹果:Apple
*****************************
```

> 目标翻译语言支持英语、日语、德语等几十种语言,用 -t 指定翻译目标语言即可

### Chinese To Japan(中文翻译日文)
```
query -t jp 我是谁
*****************************
*我是谁:私は誰ですか
*****************************

```

## query 作为一个模块导入
>默认翻译为中文,第二个参数为翻译目标语言

```
>>> from query import Query
>>> q = Query('apple')
>>> q.translate()
apple:苹果
{'src_result': 'apple', 'trans_result': '苹果'}
>>> q = Query('english', 'wyw')
>>> q.translate()
english:英吉利语
{'src_result': 'english', 'trans_result': '英吉利语'}
```

Release history Release notifications

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for query-cli, version 1.0
Filename, size File type Python version Upload date Hashes
Filename, size query_cli-1.0-py2-none-any.whl (6.4 kB) File type Wheel Python version 2.7 Upload date Hashes View hashes
Filename, size query-cli-1.0.tar.gz (3.9 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page