cambridge


Namecambridge JSON
Version 3.9.2 PyPI version JSON
download
home_pagehttps://github.com/KateWang2016/cambridge
Summarycambridge is a terminal version of Cambridge Dictionary.
upload_time2024-03-06 13:17:21
maintainerNone
docs_urlNone
authorKate Wang
requires_python>=3.5
licenseNone
keywords dictionary cambridge webster english web scraping python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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 Cambridge Dictionary
![look up a word in Cambridge Dictionary](/screenshots/cambridge.png)

#### Look up Merriam-Webster Dictionary
![look up a word in Merriam-Webster Dictionary](/screenshots/webster.png)

## 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 (assuming the optimal) to avoid being confused 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
8. colorscheme well customized to dark, light, blueish, grayish, gruvbox terminal backgrounds

## `fzf`
With [fzf](https://github.com/junegunn/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](/screenshots/fzf.png)

## Install & Uninstall
```python
pip install cambridge # install
pip uninstall cambridge && rm -rf $HOME/.cache/cambridge # uninstall and remove cache
```

## Usages
#### Command `s` (hidden)
For looking up a dictionary. Flags can be put before or after `<word/phrase>`.
```bash
camb <word/phrase>      # look up a word/phrase in Cambridge Dictionary
camb <word/phrase> -w   # look up a word/phrase in Merriam-Webster Dictionary
camb <word/phrase> -c   # look up a word/phrase in Cambridge with Chinese translation

camb <phrase with "'" > # camb "a stone's throw" | camb a stone\'s throw
camb <phrase with "/" > # camb "have your/its moments" | camb have your\/its moments

camb <word/phrase> -d   # look up a word/phrase in debug mode
camb <word/phrase> -f   # look up a word/phrase afresh without using cache
camb <word/phrase> -n   # look up a word/phrase without showing suggestions if not found
```

#### Command `l`
For listing and deleting items in the cache.
```bash
camb l                  # list alphabetically ordered words/phrases you've found before
camb l -t               # list words/phrases in reverse chronological order
camb l -r               # list 20 words/phrases from the word list randomly
camb l -d               # delete one or more words/phrases(separated by ", ") from the list
```

#### Command `wod`
For displaying 'Word of the Day' in the Merriam Webster Dictionary

#### General options
```bash
camb -h, --help         # show this help message and exit
camb -v, --version      # print the current version of the program
```

## TO-DOS
* [ ] input a new word/phrase when spelling suggestions are not satisfactory without restarting a new command line
* [ ] check a particular expression against all cached sentence examples, if found, we can confidently use it like that in our speaking or writing
* [ ] split and accumulate all sentences from a whole bulk of cache as independent Corpus, then we can use this Corpus outside this program
* [ ] strengthen 'Word of the Day' functionality from Webster

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/KateWang2016/cambridge",
    "name": "cambridge",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.5",
    "maintainer_email": null,
    "keywords": "dictionary, cambridge, webster, English, web scraping, python",
    "author": "Kate Wang",
    "author_email": "kate.wang2018@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/07/38/61ccc1c61c2983ccb539d98daae20514f3bb971def6719441938aab2ed63/cambridge-3.9.2.tar.gz",
    "platform": null,
    "description": "# Cambridge\n\n`cambridge` is a terminal version of Cambridge Dictionary, with its data from https://dictionary.cambridge.org\n\nBy default, it is English to English translation. For English to Chinese, add '-c' or '--chinese' option.\n\nSupports looking up the Merriam-Webster Dictionary, with `-w` or `--webster` option. Webster has no foreign language translation in itself.\n\n## Screenshots\n#### Look up Cambridge Dictionary\n![look up a word in Cambridge Dictionary](/screenshots/cambridge.png)\n\n#### Look up Merriam-Webster Dictionary\n![look up a word in Merriam-Webster Dictionary](/screenshots/webster.png)\n\n## Why This\nI'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.\n\n## Highlights\n1. `camb <word/phrase>` to look it up in Cambridge Dictionary by default\n2. `-w` flag to fetch Merriam-Webster Dictionary\n3. less than 2s taken to do all the work for the word, including fetching, parsing, printing, and writing cache\n4. less than 0.1s for the same word's later search\n5. only the first dictionary from Cambridge (assuming the optimal) to avoid being confused by multiple dictionaries\n6. a list of word/phrase suggestions will be given, if not found\n7. `camb l` to list words and phrases you've found before\n8. colorscheme well customized to dark, light, blueish, grayish, gruvbox terminal backgrounds\n\n## `fzf`\nWith [fzf](https://github.com/junegunn/fzf) installed, `camb l | fzf --preview 'camb {}'` will get you a taste of the `fzf` magic:\n1. display the whole word list\n2. fuzzy find a word from the word list & preview its meaning instantly\n3. preview each word definition instantly as you scroll through the list\n4. `alias cambl=\"camb l | fzf --preview 'camb {}'\"` can be added in your `.bashrc` for convenience\n\n![list words](/screenshots/fzf.png)\n\n## Install & Uninstall\n```python\npip install cambridge # install\npip uninstall cambridge && rm -rf $HOME/.cache/cambridge # uninstall and remove cache\n```\n\n## Usages\n#### Command `s` (hidden)\nFor looking up a dictionary. Flags can be put before or after `<word/phrase>`.\n```bash\ncamb <word/phrase>      # look up a word/phrase in Cambridge Dictionary\ncamb <word/phrase> -w   # look up a word/phrase in Merriam-Webster Dictionary\ncamb <word/phrase> -c   # look up a word/phrase in Cambridge with Chinese translation\n\ncamb <phrase with \"'\" > # camb \"a stone's throw\" | camb a stone\\'s throw\ncamb <phrase with \"/\" > # camb \"have your/its moments\" | camb have your\\/its moments\n\ncamb <word/phrase> -d   # look up a word/phrase in debug mode\ncamb <word/phrase> -f   # look up a word/phrase afresh without using cache\ncamb <word/phrase> -n   # look up a word/phrase without showing suggestions if not found\n```\n\n#### Command `l`\nFor listing and deleting items in the cache.\n```bash\ncamb l                  # list alphabetically ordered words/phrases you've found before\ncamb l -t               # list words/phrases in reverse chronological order\ncamb l -r               # list 20 words/phrases from the word list randomly\ncamb l -d               # delete one or more words/phrases(separated by \", \") from the list\n```\n\n#### Command `wod`\nFor displaying 'Word of the Day' in the Merriam Webster Dictionary\n\n#### General options\n```bash\ncamb -h, --help         # show this help message and exit\ncamb -v, --version      # print the current version of the program\n```\n\n## TO-DOS\n* [ ] input a new word/phrase when spelling suggestions are not satisfactory without restarting a new command line\n* [ ] check a particular expression against all cached sentence examples, if found, we can confidently use it like that in our speaking or writing\n* [ ] split and accumulate all sentences from a whole bulk of cache as independent Corpus, then we can use this Corpus outside this program\n* [ ] strengthen 'Word of the Day' functionality from Webster\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "cambridge is a terminal version of Cambridge Dictionary.",
    "version": "3.9.2",
    "project_urls": {
        "Homepage": "https://github.com/KateWang2016/cambridge"
    },
    "split_keywords": [
        "dictionary",
        " cambridge",
        " webster",
        " english",
        " web scraping",
        " python"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "aee202d374c2c6302ffe7644b26e0624483f7c2b0c35f6672b837cfad2a1aec3",
                "md5": "5e931d9237575a456379209539154b07",
                "sha256": "8ed7d1e37085135ec9c7a7e08941a5fbb1f7b679e15f278594dcb8154f4a7042"
            },
            "downloads": -1,
            "filename": "cambridge-3.9.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5e931d9237575a456379209539154b07",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.5",
            "size": 39347,
            "upload_time": "2024-03-06T13:17:14",
            "upload_time_iso_8601": "2024-03-06T13:17:14.629347Z",
            "url": "https://files.pythonhosted.org/packages/ae/e2/02d374c2c6302ffe7644b26e0624483f7c2b0c35f6672b837cfad2a1aec3/cambridge-3.9.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "073861ccc1c61c2983ccb539d98daae20514f3bb971def6719441938aab2ed63",
                "md5": "70f723adf9542a8c10973c7a78ad8458",
                "sha256": "6ac661b214667457299c9507682fd8b58d0fc9bd5cfff349675ac96d24367022"
            },
            "downloads": -1,
            "filename": "cambridge-3.9.2.tar.gz",
            "has_sig": false,
            "md5_digest": "70f723adf9542a8c10973c7a78ad8458",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5",
            "size": 711099,
            "upload_time": "2024-03-06T13:17:21",
            "upload_time_iso_8601": "2024-03-06T13:17:21.293849Z",
            "url": "https://files.pythonhosted.org/packages/07/38/61ccc1c61c2983ccb539d98daae20514f3bb971def6719441938aab2ed63/cambridge-3.9.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-06 13:17:21",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "KateWang2016",
    "github_project": "cambridge",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "cambridge"
}
        
Elapsed time: 0.21021s