• This repository has been archived on 16/Apr/2023
  • Stars
    star
    503
  • Rank 87,705 (Top 2 %)
  • Language
    Python
  • License
    GNU General Publi...
  • Created about 12 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

YouDao Console Version - Simple wrapper for Youdao online translate (Chinese <-> English) service API, as an alternative to the StarDict Console Version(sdcv).

YouDao Console Version

Simple wrapper for Youdao online translate (Chinese <-> English) service API, as an alternative to the StarDict Console Version(sdcv).

注意

本工具已经停止公共服务。用户若要继续使用,需申请一个私人的有道智云 API Key配置使用。 大致步骤为: 翻译实例-创建实例-选"文本翻译", 我的应用-创建应用-接入方式:API-选择绑定刚才创建的自然语言翻译服务-文本翻译实例。 得到的应用ID / 应用密钥即为本工具的YDAPPID/YDAPPSEC

本工具可通过环境变量YDCV_YOUDAO_APPIDYDCV_YOUDAO_APPSEC和ini文件方式配置key。配置文件默认为~/.ydcv,也可用--config指定。 配置文件例子:

[YDCV]
YDAPPID=123456
YDAPPSEC=abcd1234

Usage

$ ydcv --help
usage: ydcv.py [-h] [-f] [-s] [-S] [-r] [-p {festival,mpg123,sox,mpv}]
               [-a {auto,uk,us}] [-x] [--color {always,auto,never}]
               [-F {zh-CHS,ja,EN,ko,fr,ru,pt,es,vi,de,ar,id}]
               [-t {zh-CHS,ja,EN,ko,fr,ru,pt,es,vi,de,ar,id}]
               [words [words ...]]

Youdao Console Version

positional arguments:
  words                 words to lookup, or quoted sentences to translate.

optional arguments:
  -h, --help            show this help message and exit
  -f, --full            print full web reference, only the first 3 results
                        will be printed without this flag.
  -s, --simple          only show explainations. argument "-f" will not take
                        effect.
  -S, --speech          print URL to speech audio.
  -r, --read            read out the word with player provided by "-p" option.
  -p {festival,mpg123,sox,mpv}, --player {festival,mpg123,sox,mpv}
                        read out the word with this play.Default to 'festival'
                        or can be 'mpg123', 'sox', 'mpv'.-S option is required
                        if player is not festival.
  -a {auto,uk,us}, --accent {auto,uk,us}
                        set default accent to read the word in. Default to
                        'auto' or can be 'uk', or 'us'.
  -x, --selection       show explaination of current selection.
  --color {always,auto,never}
                        colorize the output. Default to 'auto' or can be
                        'never' or 'always'.
  -F {zh-CHS,ja,EN,ko,fr,ru,pt,es,vi,de,ar,id}, --from {zh-CHS,ja,EN,ko,fr,ru,pt,es,vi,de,ar,id}
                        Translate from specific language. Default: EN
  -t {zh-CHS,ja,EN,ko,fr,ru,pt,es,vi,de,ar,id}, --to {zh-CHS,ja,EN,ko,fr,ru,pt,es,vi,de,ar,id}
                        Translate to specific language. Default: zh-CHS
  -c CONFIG, --config CONFIG
                        Config file contains API AppKey / SecKey. Default: ~/.ydcv
          

翻译支持的语言列表

--from--to参数可以指定特定语言之间相互翻译,但只有中文结果有词典内容

语言 代码 语言 代码 语言 代码 语言 代码
中文 zh-CHS 葡萄牙文 pt 韩文 ko 德文 de
日文 ja 西班牙文 es 法文 fr 阿拉伯文 ar
英文 EN 越南文 vi 俄文 ru 印尼文 id

Installation

pip install ydcv

Environment

  • Python ( >=2.7, 3.x )

Similar Projects on github

Lang Project Author
Go ydgo boypt
RUST ydcv-rs farseerfc
RUST ydcv-rust passchaos
Powershell ydcv.ps1 atupal
BASH ydcv-bash-version MasterCsquare
Perl ydcv JaHIY
C cydcv proudzhu
C++ ydcv-cpp proudzhu
Vim ydcv.vim bennyyip
Erlang ydcv-el zhenglinj
Haskell ydcv-hs proudzhu

More Repositories

1

dnsmasq-china-list

Chinese-specific configuration to improve your favorite DNS server. Best partner for chnroutes.
Ruby
5,533
star
2

BaiduPCS-Go

Re-upload of iikira/BaiduPCS-Go
Go
911
star
3

fcitx5-pinyin-zhwiki

Fcitx 5 Pinyin Dictionary from zh.wikipedia.org
Python
561
star
4

vps2arch

The fastest way to convert a VPS to Arch Linux! (forked from gitlab:drizzt/vps2arch)
Shell
274
star
5

archriscv-packages

Modified Arch Linux packages for archriscv
Shell
203
star
6

aur3-mirror

Git archive of the Arch User Repository 3. (Cloned from pkgbuild.com/git/aur-mirror.git)
Shell
61
star
7

chnroutes-alike

Personal collection of IP ranges not in China but work good enough
Python
26
star
8

archlinux-futils

Felix's Arch Linux utilities
Python
25
star
9

telegramirc

Telegram as your IRC client
Python
23
star
10

fcitx-tsundere

Fcitx Tsundere Addon
C
17
star
11

anycast-routes

Experimental collection of anycast routes
16
star
12

bottle-github-webhook

A very simple github post-receive web hook handler
Python
8
star
13

pmgmusic

PMG, a VOS clone for linux.
C
8
star
14

dotfiles

Yet another dotfiles repo
6
star
15

felixonmars

4
star
16

suds-ng

A lightweight SOAP python client for consuming Web Services forked from suds (https://fedorahosted.org/suds/).
Python
4
star
17

github-show-contributions-language

Userscript to show repository language next to your contribution history on GitHub
JavaScript
3
star
18

6rdctl

6rd Control Tool
Python
3
star
19

LogChecker

LogChecker macro for Moinmoin
Python
3
star
20

pacman-dkms

Pacman hook to trigger DKMS installation after kernel headers installed
2
star
21

froute

froute = Felix route, a simple route config tool for myself.
Shell
2
star
22

nss-no-cnnic

Patch to remove CNNIC and other suspect CA in China by default from nss in system-wide
2
star
23

volume_key

Unofficial mirror of https://pagure.io/volume_key.git
C
2
star
24

nvchecker-contrib

Additional source for nvchecker
2
star
25

openvpn-reloader

Reload your openvpn process when packet loss suddenly arise.
Python
2
star
26

driver-center

Collect anonymous hardware info and give correct drivers to you
Python
1
star
27

panda-topbar

System topbar.
C++
1
star
28

autoswap

(Deprecated) Systemd unit to enable all swap area in current machine
1
star
29

tagbot

Tagbot for Twitter - Instant Tagging Bot Using Streaming API
Python
1
star
30

debootstrap

Unofficial mirror of https://anonscm.debian.org/git/d-i/debootstrap.git
Shell
1
star
31

select-to-speech

A simple select-to-speech tool for Linux
Python
1
star
32

process

process Action for Moinmoin
Python
1
star