Cambridge dictionary cli app
Warning
cambd is currently not working. dictionary.cambridge.org is now behind a Cloudflare bot challenge and returns 403 to plain HTTP requests, so every lookup fails with "No definition found". This affects the whole site, not just one endpoint, and it is not fixable by changing the request headers or User-Agent - clearing the challenge requires running its JavaScript. A fix means moving to a headless browser or a different data source; no decision made yet. Tracking this before spending time on a PR.
- Automatically suggests related words when a typo is detected.
- Provides an interactive suggestion menu for selecting the correct word in case of a typo.
- Supports past and past participle forms, returning the definition of the root word.
- Operates without relying on any external APIs or databases.
- Implements persistent caching to store previously searched words, ensuring faster results. The cache is maintained using Python's built-in
sqlite3.
pip install cambdOr using pipx
pipx install cambdUsage: cambd [OPTIONS] WORD
Options:
-a, --show-all Show all the definitions of a word.
-d, --dictionary TEXT Determine which dictionary region to use (uk, us) [default: uk]
-v, --verbose Show extra word info ie, word codes & labels. [ex: A2 informal]
-c, --clear-cache Clear all the stored cache from system.
--version Show the version and exit.
--help Show this message and exit.Q. Why scrape instead of using a Dictionary API?
Note
TBH, As a non native english speaker, I find the cambridge dictionary the most easy to understand. But they don't have any public free API with all the features I want like getting suggestions on misspelled words and give both US and UK definations etc. So I ended up building this cli tool with basic scrapping for my own usecase as I am a terminal power user and don't want to leave the terminal, go to browser, open a new tab just to search for a word meaning.
MIT License © Rocktim Saikia 2024
