Skip to main content

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:

  1. simple
  2. scales with respect to terminal width
  3. small footprint

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.

State

  • up to v0.1.3: 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!
  • 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

  1. Download the source code from github.

  2. Make dictcc-mini/src directory available via PYTHONPATH environment variable.

    1. export PYTHONPATH=$PYTHONPATH:/your/path/to/dictcc-mini/src
      
  3. Alias in an rc-file of your shell in one of the following two ways.

    1. 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

dictcc_mini-0.2.1.tar.gz (241.5 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.2.1-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for dictcc_mini-0.2.1.tar.gz
Algorithm Hash digest
SHA256 681adfc303208135cf23a0c6c881507cff578620d4645b5b8181e178390ff725
MD5 fe1ea1f46054045525e49664b04d2307
BLAKE2b-256 e0064e4f02e4a1e195ffe0e2a4bca1fcaf82012a445f6b86b4a97c990b1364cb

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for dictcc_mini-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cbe971880ee22e7beb44aa7eb87fa2497ee1d026cab6e07ced634820f2a77220
MD5 c14c02a78e4d95ec80cf88138e0494b6
BLAKE2b-256 a2a24f42fe83cc5a4d17dd690bff58f6592aca9eaf1c04ddbe771fe976b37c20

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