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 | RSS feed

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.

Source Distribution

query-cli-1.0.tar.gz (3.9 kB view hashes)

Uploaded source

Built Distribution

query_cli-1.0-py2-none-any.whl (6.4 kB view hashes)

Uploaded 2 7

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page