Skip to main content

Cambridge is a terminal version of Cambridge Dictionary.

Project description

Cambridge

Cambridge is a terminal version of Cambridge Dictionary.

The dictionary data comes from https://dictionary.cambridge.org

If you're not satisfied with the result, you can try with "-w" flag to look up the word in Merriam-Webster Dictionary.

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.

Features

  1. camb <word/phrase> to look up what you need.
  2. Takes < 2s for the first time, including fetching, parsing, printing, and writing cache.
  3. Less than 0.1s for the same term's later search.
  4. Fetches the first dictionary on Cambridge, avoiding confuses by multiple dictionaries.
  5. If not found, a list of related suggestions will be displayed.
  6. camb l to list words and phrases you've found before.

With fzf

camb l | fzf --preview 'camb {}', if you've installed fzf, you'll get the following magics:

  1. fuzzy finding a word from the word list & instantly previewing its meaning
  2. displaying the whole word list & instantly previewing each word meaning as you scroll through the list list words
  3. You can also add alias cambl="camb l | fzf --preview 'camb {}'" in your shell config for convenience

Installation

pip install cambridge

Usage

camb <word/phrase>     e.g. camb pertinent  # 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 l                                      # list words found before in alphabetical order
camb l -t                                   # list words found before in reverse chronological order
camb l -r                                   # list 20 words from the word list randomly 
camb l -d                                   # delete a word from the word 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.0.4.tar.gz (515.9 kB view details)

Uploaded Source

Built Distribution

cambridge-3.0.4-py2.py3-none-any.whl (33.1 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

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

File hashes

Hashes for cambridge-3.0.4.tar.gz
Algorithm Hash digest
SHA256 2e39c23233bf1b9116f0a4ea9b32fe8c0ecc6e552d5d665e63e83c5217e233bb
MD5 18858c239cd31f414e8feded3936fe56
BLAKE2b-256 cc4e201837f48bc8e8dd31d623c7e884e4311671da59ff33ba8817094ce5576f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for cambridge-3.0.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 da4e9367ed2db161a08f6fc5b7da9bffa230c5a853bad19415508eb01b7cd17a
MD5 a6fbf2023dc669b8356438ee545a13f4
BLAKE2b-256 f5a8eea66e866da0cf5a6cfb2e271ea975fb297e1ae56a93c31d56990ba75ac1

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