Skip to main content

A lightweight, 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:

  1. simple
  2. small footprint
    • depends only on: requests, beautifulsoup4 and fake-headers
    • site-packages in freshly installed VENV including all transient dependencies like html5lib, idna, urllib3 is sub 20 MB!
  3. scales with respect to terminal width

dictcc-mini screenshot



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

  1. Download the source code from github.

  2. Install dependencies (requests, beautifulsoup4, fake_headers) with pip install -r requirements.txt.

  3. 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/src directory to you PYTHONPATH environment variable.

    1. export PYTHONPATH=$PYTHONPATH:/your/path/to/dictcc-mini/src
      
    2. 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 available to set in config.py.



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

dictcc_mini-0.1.2.tar.gz (239.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dictcc_mini-0.1.2-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file dictcc_mini-0.1.2.tar.gz.

File metadata

  • Download URL: dictcc_mini-0.1.2.tar.gz
  • Upload date:
  • Size: 239.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.15.0a7

File hashes

Hashes for dictcc_mini-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2beb6ebed9a5a421698302ac93a6e0d764a302f4dbefec7695cb497ea65c06c1
MD5 2df73e9e3883d3dabe9bf5b8ae588273
BLAKE2b-256 5508b88aa14e7f2cb7baf6e215d383892478d1a149267f25b48a2126027f45f7

See more details on using hashes here.

File details

Details for the file dictcc_mini-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: dictcc_mini-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.15.0a7

File hashes

Hashes for dictcc_mini-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6e9aaf2c86d5e326371a2a3f87157b5bed80e649b9027f070fe89638749cef1d
MD5 5a59d70c7dea7be842f470dcd72abc31
BLAKE2b-256 ce0ec1bb4c77f0a9201e26238e1513d091d9a831d29276fbf89d333134b1eea2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page