Skip to content
rebornczsPublic
forked from chenjiandongx/fy

About

🌐 Translate words via command line

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

39 Commits

Folders and files

Repository files navigation

pyecharts logo

🌐 fy

Translate words via command line. Inspired by afc163/fanyi, but more features.

Travis Build Status Appveyor Build Status Appveyor Build Status PyPI - Python Version PyPI - Python Version MIT License

✨ 特性

  • 单词字典查询
  • 中英句子互译
  • 关键词高亮
  • 发音(只在 Windows 下,Linux/MacOS 暂时未找到合适的第三方库)
  • Prompt shell,支持单词补全
  • 支持配置文件(配置查询来源以及对应接口的 TOKEN KEY)
  • records shell,记录查询历史

🔰 安装

pip 安装

$ pip install fy

源码安装

$ git clone https://github.com/chenjiandongx/fy.git
$ cd fy
$ pip install -r requirements.txt
$ python setup.py install

📝 使用

usage: fy [-h] [-s] [-r] [-v] [WORDS [WORDS ...]]

Translate words via command line

positional arguments:
  WORDS          the words to translate

optional arguments:
  -h, --help     show this help message and exit
  -s, --shell    spawn the query prompt shell
  -r, --records  spawn the records prompt shell
  -v, --version  displays the current version of fy

查单词

英译中

中译英

query prompt shell

records prompt shell

数据表名称为 words

🔧 配置

配置文件内容为

$ car ~/.fy.json

{
    "query_source": "youdao,iciba",
    "youdao_key": "1945325576",
    "youdao_key_from": "Youdao-dict-v21",
    "iciba_key": "4B26F43688FA072E0B94F68FFCE224CF",
    "enable_sound": true
}

查询源

目前支持 youdao 以及 iciba,如果只想使用 youdao 源,可修改为 query_source: "youdao",iciba 同理

TOKEN KEY

现在两个暂时使用的都是我自己申请的,youdao 有限制,iciba 没有,开发者可以自行申请替换。

📅 Changelog

V1.4.1 - 2018-01-28

  • Add: 新增关闭声音配置项

V1.4.0 - 2019-01-28

  • Update: 使用 sqlite prompt shell

V1.3.0 - 2019-01-27

  • Add: 支持保存历史查询记录

V1.2.1 - 2019-01-26

  • Update: 声明支持的 Python 版本

V1.2.0 - 2019-01-26

  • Add: 提供配置文件

V1.1.0 - 2019-01-25

  • Add: 新增发音功能

V1.0.0 - 2019-01-24

  • Alpha: 第一个正式版发布

📃 LICENSE

MIT ©chenjiandongx

About

🌐 Translate words via command line

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages