Skip to main content

Duden Version

duden is a CLI-based program and python module, which can provide various information about given german word. The provided data are parsed from german dictionary duden.de.

duden screenshot

Installation

pip3 install duden

Usage

CLI

$ duden Löffel

Löffel, der
===========
Word type: Substantiv, maskulin
Commonness: 2/5
Separation: Löf|fel
Meaning overview:
 0.  a. [metallenes] [Ess]gerät, an dessen unterem Stielende eine schalenartige Vertiefung sitzt und das zur Aufnahme von Suppe, Flüssigkeiten, zur Zubereitung von Speisen o. Ä. verwendet wird
     b. (Medizin) Kürette

 1. (Jägersprache) Ohr von Hase und Kaninchen

Synonyms:
Ohr; [Ge]hörorgan; (salopp) Horcher, Horchlappen, Lauscher; (Jägersprache) Loser, Teller
Full CLI syntax (expand)
$ duden --help
usage: duden [-h] [--title] [--name] [--article] [--part-of-speech] [--frequency] [--usage]
             [--word-separation] [--meaning-overview] [--synonyms] [--origin] [--grammar-overview]
             [--compounds [COMPOUNDS]] [-i] [--export] [--words-before] [--words-after] [-r RESULT] [--fuzzy]
             [--no-cache] [-V] [--phonetic] [--alternative-spellings]
             word

positional arguments:
  word

options:
  -h, --help            show this help message and exit
  --title               display word and article
  --name                display the word itself
  --article             display article
  --part-of-speech      display part of speech
  --frequency           display commonness (1 to 5)
  --usage               display context of use
  --word-separation     display proper separation (line separated)
  --meaning-overview    display meaning overview
  --synonyms            list synonyms (line separated)
  --origin              display origin
  --grammar-overview    display short grammar overview
  --compounds [COMPOUNDS]
                        list common compounds
  -i, --inflect         display inflections
  --export              export parsed word attributes in yaml format
  --words-before        list 5 words before this one
  --words-after         list 5 words after this one
  -r RESULT, --result RESULT
                        display n-th (starting from 1) result in case of multiple words matching the input
  --fuzzy               enable fuzzy word matching
  --no-cache            do not cache retrieved words
  -V, --version         print program version
  --phonetic            display pronunciation
  --alternative-spellings
                        display alternative spellings

Module usage

>>> import duden
>>> w = duden.get('Loeffel')
>>> w.name
'Löffel'
>>> w.word_separation
['Löf', 'fel']
>>> w.synonyms
'Ohr; [Ge]hörorgan; (salopp) Horcher, Horchlappen, Lauscher; (Jägersprache) Loser, Teller'

For more examples see usage documentation.

Development

Dependencies and packaging are managed by Poetry.

Install the virtual environment and enter it with

$ poetry install
$ poetry shell

Testing and code style

To execute data tests, run

$ pytest

To run python style autoformaters (isort, black), run

$ make autoformat

Localization

Apart from English, this package has partial translations to German, Spanish, and Esperanto languages.

To test duden in other languages, set the LANG environment variable before running duden like so:

LANG=de_DE.UTF-8 duden Kragen
LANG=es_ES.UTF-8 duden Kragen
LANG=eo_EO.UTF-8 duden Kragen

The translations are located in the duden/locale/ directory as the *.po and duden.pot files. The duden.pot file defines all translatable strings in series of text blocks formatted like this:

#: main.py:82
msgid "Commonness:"
msgstr ""

while the individual language files provides translations to the strings identified by msgid like this:

#: main.py:82
msgid "Commonness:"
msgstr "Häufigkeit:"

Note that the commented lines like #: main.py:82 do not have any functional meaning, and can get out of sync.

Publishing

To build and publish the package to (test) PyPI, you can use one of these shortcut commands:

$ make pypi-publish-test
$ make pypi-publish

(these also take care of building the localization files before calling poetry publish)

Poetry configuration for PyPI and Test PyPI credentials are well covered in this SO answer.

Including localization data in the package

In order for the localization data to be included in the resulting python package, the *.po files must be compiled using the

$ make localization

command before building the package with poetry.

Supported versions of Python

  • Python 3.4+

Metadata

Release files for duden 0.19.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for duden 0.19.2
File Size Uploaded Provenance Actions
duden-0.19.2.tar.gz 22.1 kB Without provenance Details for duden-0.19.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for duden 0.19.2
File Interpreter ABI Platform Actions
duden-0.19.2-py3-none-any.whl Python 3 none any Details for duden-0.19.2-py3-none-any.whl

Total release size: 47.6 kB

Release files / duden-0.19.2.tar.gz

Download URL duden-0.19.2.tar.gz
Size 22.1 kB
Tags Source
SHA-256 checksum
How to use checksums
66c85f912f0a8ac38c6784f17ad64e2f5ffe70726ccc7f756f2283dcdcd91f15
BLAKE2b-256 checksum
How to use checksums
8e3aa47f7d19d3cd1c3d50fca8471860eb25a44494fb09970ba3334222d626bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.4 CPython/3.13.1 Linux/6.8.0-79-generic

Release files / duden-0.19.2-py3-none-any.whl

Download URL duden-0.19.2-py3-none-any.whl
Size 25.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7fd87110325010bc986376d400936d2f1557f9aace60dccb575075b1f4f3087f
BLAKE2b-256 checksum
How to use checksums
ca2df7ef44a35f03932a6d73675dcac6340115802899a28bb9277eebe9698135
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.4 CPython/3.13.1 Linux/6.8.0-79-generic

Security for duden 0.19.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page