A lightweight, width-aware terminal formatter for dict.cc translations.
Project description
dictcc-cli
Quickly look up translations without relying on the browser. This script is mostly just a fancy table formatter which happens to get it's data for formatting from dict.cc.
Features:
- simple
- small footprint
- depends only on:
requests,beautifulsoup4andfake-headers site-packagesin freshly installed VENV including all transient dependencies likehtml5lib,idna,urllib3is sub 20 MB!
- depends only on:
- scales with respect to terminal width
About
I wanted a tool for the most convenient and quick access to vocab through cli. There is another similar tool already available which is more feature rich, but it has a larger dependency footprint. I've deliberately opted against depending on rich for formatting and lxml for parsing.
How to setup
pypi
classical: pip install dictcc-mini
manual
-
Download the source code from github.
-
Install dependencies (requests, beautifulsoup4, fake_headers) with
pip install -r requirements.txt. -
I recommend aliasing in an rc-file of your shell in one of the following two ways. For this to work you'll need to add the
dictcc-mini/srcdirectory to youPYTHONPATHenvironment variable.-
export PYTHONPATH=$PYTHONPATH:/your/path/to/dictcc-mini/src
-
alias dict="python3 -m dictcc_mini.cli " function dict() { "python3 -m dictcc_mini.cli" "$@" }
-
defaults
As per my own preference, this script defaults to DE/EN as languages, which are
simply set as DEFAULT_LANG1 and DEFAULT_LANG2 constants in the languages.py
and easily modified to match your preference.
How to use
# regular lookup
dict word
# to start with language selector before search use -l (--language) toggle
dict word -l
# set -f (--full) toggle full table if default 20 line table is too short
dict word -f
Project details
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dictcc_mini-0.1.1.tar.gz.
File metadata
- Download URL: dictcc_mini-0.1.1.tar.gz
- Upload date:
- Size: 239.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.15.0a7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b5b8a549eb1cba5ee95010dfd9cd677a49781095a71ece1e5a506dda6e1631c
|
|
| MD5 |
de44913545fcd5c28ce8bb13c1b3e90c
|
|
| BLAKE2b-256 |
f753fa2a355fc03abe397d28d073a2db9ddd00523bc3ff47d4c8d2de70f4a32c
|
File details
Details for the file dictcc_mini-0.1.1-py3-none-any.whl.
File metadata
- Download URL: dictcc_mini-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.15.0a7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a86414c2dbca67b08fa73a55d5657ed3b3ee3d64a8d45183cb3863e6eeafddd8
|
|
| MD5 |
711b9f8706b635af5286f0b1cf632ccd
|
|
| BLAKE2b-256 |
e787b0ac3ecbbed5e161c867257040dd3eb3d669bcdee30099b9899efdafb03e
|