Skip to main content

Offline dictionary in the terminal

Project description

DictionarPy

An extensible offline dictionary application, in the terminal

The dictionary comes prepopulated with a little over 54,000 words and 120,000 definitions available for offline reference. It is also designed to be added to and grow with your lexicon.

Some things you can do:

  1. Add and remove words, parts of speech, definitions, IPA transcriptions
  2. Show random words
  3. Get similar words
  4. Reference the built-in IPA key
  5. Search within definitions for a particular string
  6. Find anagrams of words

Statistics regarding this version's included dictionary

$ dpy -ns
Words:               54224
Definitions:         120077
IPA Transcriptions:  30073
Disk size:           10.75MB
──────────────────────────────────────────
Parts of speech:
    preposition  idiom  transitive verb
    nom  plural noun  intransitive verb
    article  nound  nom masculin commun
    abbreviation  adverb  ambitransitive
    verb  determiner  interjection
    auxiliary verb  conjunction
    contraction  definite article
    adjective  adjectif  abréviation  nom
    masculin  pronoun  noun  verb  nom
    féminin  phrase  verbe
    transitive/intransitive verb

Examples

  • Add a word/definition to the database

    $ dpy -w "my new word" -p "my part of speech" -d "my definition!"
    
  • Add or update the phonetic/phonemic transcription of a word

    $ dictionarpy -w "my new word" -i "/mj nu wɝd/"
    
  • Show the definitions for a word (use -n to avoid ansi escape sequences)

    $ dictionarpy -n "my new word"                                                
    ┌──────────────────────┐
    │     my new word      │
    │     /mj nu wɝd/      │
    ├──────────────────────┤
    │ 1. my part of speech │
    │    my definition!    │
    └──────────────────────┘
    
  • Remove a definition from the database

    $ dictionarpy -r 1 "my new word"
    
  • Remove an entry from the database

    $ dictionarpy -R "remove_this_word"
    
  • Learn a random word!

    $ dpy "$(dpy -z)"
    

For help and additional functionality:

$ dpy -h
usage: dpy [-h] [-n] [-e] [-s] [-0] [-t [N]] [-g [IPA SYMBOL]] [-c]
           [-z [PART OF SPEECH]] [-a] [-r INDEX] [-R] [-f STRING]
           [-w ADD_WORD] [-p ADD_POS] [-d ADD_DEF] [-i ADD_IPA] [-P N] [-D N]
           [-I] [-v]
           [word]

Offline dictionary

positional arguments:
  word                  Word to be defined

options:
  -h, --help            show this help message and exit
  -n, --no-ansi         Don't use ansi escape sequences
  -e, --no-stemming     Don't use Porter Stemming on a word if it's not found
  -s, --stats           Show database statistics
  -0, --empty           Show words that do not possess definitions
  -t, --tail [N]        Show last N words added to the database. N=10 if left
                        empty
  -g, --ipa-guide [IPA SYMBOL]
                        Show ipa guide (empty for all)
  -c, --ipa-charts      Show ipa charts
  -z, --random [PART OF SPEECH]
                        Return a random word
  -a, --anagrams        Show anagrams for word
  -r, --remove-def INDEX
                        Remove a definition specified by its index
  -R, --remove-word     Remove a word
  -f, --find-in-defs STRING
                        Show entries which contain STRING in definitions
  -w, --add-word ADD_WORD
                        Word to add/word to add to
  -p, --add-pos ADD_POS
                        Part of speech to add
  -d, --add-def ADD_DEF
                        Definition to add
  -i, --add-ipa ADD_IPA
                        Pronunciation to add
  -P, --show-pos N      Only show word's part of speech at Nth index
  -D, --show-def N      Only show word's definition at Nth index
  -I, --show-ipa        Only show word's pronunciation
  -v, --version         Show version

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

dictionarpy-2.6.4.tar.gz (4.8 MB view details)

Uploaded Source

Built Distribution

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

dictionarpy-2.6.4-py3-none-any.whl (4.8 MB view details)

Uploaded Python 3

File details

Details for the file dictionarpy-2.6.4.tar.gz.

File metadata

  • Download URL: dictionarpy-2.6.4.tar.gz
  • Upload date:
  • Size: 4.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for dictionarpy-2.6.4.tar.gz
Algorithm Hash digest
SHA256 fbb74472483b3f75d861019c7d45248b5b7226ab0df31bd853253d1e5b5bc0a6
MD5 066c462f88ec3dd922cffb7d18d38c89
BLAKE2b-256 6bce15650fa44fa74f532151703e14c51913db1ea6584d7f877e8ddea7258b1a

See more details on using hashes here.

File details

Details for the file dictionarpy-2.6.4-py3-none-any.whl.

File metadata

  • Download URL: dictionarpy-2.6.4-py3-none-any.whl
  • Upload date:
  • Size: 4.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for dictionarpy-2.6.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5f0b1e3d53f53d9b320008aa18fcc61b1093e11b63350e3bbcbe7b37344edc39
MD5 3ed97840b74143283b1b4554ac1a836f
BLAKE2b-256 9f2d5fb90f908fca7d0e535e20731582876c5161e8070f4b4149d9a355658ec3

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