A simple and lightweight terminal formatter for dict.cc translations.
Project description
dictcc-mini
Quickly look up translations without relying on the browser. This script is mostly just a table formatter which happens to get it's data for formatting from dict.cc.
Features:
- simple
- scales with respect to terminal width
- small footprint
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.
State
- up to v0.1.3: depends only on:
requests,beautifulsoup4andfake-headers.site-packagesin freshly installed VENV including all transient dependencies likehtml5lib,idna,urllib3is sub 20 MB! - since v0.2.0: No dependencies left after implementing the relevant logic with python standard library. Now sub MB size!
How to setup
pypi
classical: pip install dictcc-mini
manual
-
Download the source code from github.
-
Make
dictcc-mini/srcdirectory available viaPYTHONPATHenvironment variable.-
export PYTHONPATH=$PYTHONPATH:/your/path/to/dictcc-mini/src
-
-
Alias in an rc-file of your shell in one of the following two ways.
-
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 config.py
and easily modified to match your preference.
Different styles for marking multiline entries and other defaults available to
set in config.py as well.
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.2.0.tar.gz.
File metadata
- Download URL: dictcc_mini-0.2.0.tar.gz
- Upload date:
- Size: 241.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.15.0a8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2a1675558f7e276bf690ea09d573ba4b7e5b57c55632a98f26c9fea369c4c4a
|
|
| MD5 |
804fe56e775fecdbb4e1f2d8c6a979d7
|
|
| BLAKE2b-256 |
f1cb8a6b196ac9769c78ca7990e52c32f7a0fd9a9ed35dc91bdfb07c43b3bb20
|
File details
Details for the file dictcc_mini-0.2.0-py3-none-any.whl.
File metadata
- Download URL: dictcc_mini-0.2.0-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.15.0a8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c98f7e90470cd7883e84d24a4d4a87a42916a41880c5b394807bd67e62a3f8dd
|
|
| MD5 |
7e81091f9ec15f24cdee565dc7a883e1
|
|
| BLAKE2b-256 |
138d77a607d77f03d022de7328b4f67378a1eddb54acbc4a3bb6494b007ebc30
|