cambridge is a terminal version of Cambridge Dictionary.
Project description
Cambridge
cambridge
is a terminal version of Cambridge Dictionary, with its data from https://dictionary.cambridge.org
By default, it is English to English translation. For English to Chinese, add '-c' or '--chinese' option.
Supports looking up the Merriam-Webster Dictionary, with -w
or --webster
option. Webster has no foreign language translation in itself.
Screenshots
Why This
I'm a terminal person tired of pulling out a GUI app or browser, inputting words in the search bar, hitting the search button and then waiting for the result to render with a bunch of unnecessary static files coming along. Not only is the time taken long, but also switching apps back and forth can be annoying. So I wrote this console application with features to my satisfaction.
Highlights
camb <word/phrase>
to look it up in Cambridge Dictionary by default-w
flag to fetch Merriam-Webster Dictionary- less than 2s taken to do all the work for the word, including fetching, parsing, printing, and writing cache
- less than 0.1s for the same word's later search
- only the first dictionary from Cambridge, avoiding confuses by multiple dictionaries
- a list of word/phrase suggestions will be given, if not found
camb l
to list words and phrases you've found before
fzf
With fzf installed, camb l | fzf --preview 'camb {}'
will get you a taste of the fzf
magic:
- display the whole word list
- fuzzy find a word from the word list & preview its meaning instantly
- preview each word definition instantly as you scroll through the list
alias cambl="camb l | fzf --preview 'camb {}'"
can be added in your bashrc for convenience
Installation
pip install cambridge
Usage
camb <word/phrase> # look up a word/phrase in Cambridge Dictionary
camb <word/phrase> -v # look up a word/phrase in verbose/debug mode
camb <word/phrase> -w # look up a word/phrase in Merriam-Webster Dictionary
camb <word/phrase> -f # look up a word/phrase afresh without using cache
camb <word/phrase> -c # look up a word/phrase in Cambridge with Chinese translation
camb l # list words/phrases found before in alphabetical order
camb l -t # list words/phrases found before in reverse chronological order
camb l -r # list 20 words/phrases from the word list randomly
camb l -d # delete one or multiple words/phrases(seperated by ",") from the list
camb <phrase with an apostrophe> # camb "a stone's throw" | camb a stone\'s throw
camb <phrase with a slash> # camb "have your/its moments" | camb have your\/its moments
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cambridge-3.5.12.tar.gz
.
File metadata
- Download URL: cambridge-3.5.12.tar.gz
- Upload date:
- Size: 518.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c46ef43d002e0784e7b9f3622c5200c27e0d025331ddc8ab3c60c094becdb105 |
|
MD5 | 796baed2aa7858059a4992d2087281a0 |
|
BLAKE2b-256 | 773c1635d946a3fc4ddc6852ae8c16a593ce855bd6788eea03eb503dbd979c65 |
File details
Details for the file cambridge-3.5.12-py3-none-any.whl
.
File metadata
- Download URL: cambridge-3.5.12-py3-none-any.whl
- Upload date:
- Size: 34.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78d711dba8517e802d3567ff6f4ee7e7ce04db46870e320195fd738bfb39c7e3 |
|
MD5 | 7f1967e7f3827b7ffabe56a198d8011e |
|
BLAKE2b-256 | 3dee7a48fbdbcabe35a068e20eaa992af01781694b645341986d8a8fd544bb8b |