Skip to main content

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

look up a word

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

  1. camb <word/phrase> to look it up in Cambridge Dictionary by default
  2. -w flag to fetch Merriam-Webster Dictionary
  3. less than 2s taken to do all the work for the word, including fetching, parsing, printing, and writing cache
  4. less than 0.1s for the same word's later search
  5. only the first dictionary from Cambridge, avoiding confuses by multiple dictionaries
  6. a list of word/phrase suggestions will be given, if not found
  7. 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:

  1. display the whole word list
  2. fuzzy find a word from the word list & preview its meaning instantly
  3. preview each word definition instantly as you scroll through the list
  4. alias cambl="camb l | fzf --preview 'camb {}'" can be added in your bashrc for convenience

list words

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

cambridge-3.4.5.tar.gz (517.3 kB view details)

Uploaded Source

Built Distribution

cambridge-3.4.5-py2.py3-none-any.whl (33.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file cambridge-3.4.5.tar.gz.

File metadata

  • Download URL: cambridge-3.4.5.tar.gz
  • Upload date:
  • Size: 517.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.1

File hashes

Hashes for cambridge-3.4.5.tar.gz
Algorithm Hash digest
SHA256 e7dc048c8828b8f8524487caa450f6febd61fe7f8351b4a407b011e945f98f79
MD5 879e18f652a0dd335a20a10a7deb0d2c
BLAKE2b-256 92e74269662402db95c796ce39509c8be86b1435e5f4ebbf990c495bd2eaeb19

See more details on using hashes here.

File details

Details for the file cambridge-3.4.5-py2.py3-none-any.whl.

File metadata

  • Download URL: cambridge-3.4.5-py2.py3-none-any.whl
  • Upload date:
  • Size: 33.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.1

File hashes

Hashes for cambridge-3.4.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 08797bb0c39056df8dd1d42d1db04d0b60399b696e367fbf335f2cc5e340193e
MD5 854379980a7b4ed87878ac33a2b8b51a
BLAKE2b-256 3bc5f53dd7d9aa808d52b75eff6d8e997fe30a2db2cd33045725550ae87afba6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page