Package: duden
Dudendudenis a CLI-based program and python module, which can provide various information about given german word. The provided data are parsed from german dictionaryduden.de.Installationpip3 install dudenUsageCLI$dudenLöffelLöffel, der===========Word type: Substantiv, maskulinCommonness: 2/5Separation: Löf|felMeaning 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 wirdb. (Medizin) Kürette1. (Jägersprache) Ohr von Hase und KaninchenSynonyms:Ohr; [Ge]hörorgan; (salopp) Horcher, Horchlappen, Lauscher; (Jägersprache) Loser, TellerFull CLI syntax (expand)$duden--helpusage: 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]wordpositional arguments:wordoptions:-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 RESULTdisplay 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-spellingsdisplay alternative spellingsModule usage>>>importduden>>>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 seeusage documentation.DevelopmentDependencies and packaging are managed byPoetry.Install the virtual environment and enter it with$poetryinstall$poetryshellTesting and code styleTo execute data tests, run$pytestTo run python style autoformaters (isort, black), run$makeautoformatLocalizationApart from English, this package has partial translations to German, Spanish, and Esperanto languages.To test duden in other languages, set theLANGenvironment variable before running duden like so:LANG=de_DE.UTF-8 duden KragenLANG=es_ES.UTF-8 duden KragenLANG=eo_EO.UTF-8 duden KragenThe translations are located in theduden/locale/directory as the*.poandduden.potfiles. Theduden.potfile 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 bymsgidlike this:#: main.py:82
msgid "Commonness:"
msgstr "Häufigkeit:"Note that the commented lines like#: main.py:82do not have any functional meaning, and can get out of sync.PublishingTo build and publish the package to (test) PyPI, you can use one of these shortcut commands:$makepypi-publish-test$makepypi-publish(these also take care of building the localization files before callingpoetry publish)Poetry configuration for PyPI and Test PyPI credentials are well covered inthis SO answer.Including localization data in the packageIn order for the localization data to be included in the resulting python package, the*.pofiles must be compiled using the$ make localizationcommand before building the package withpoetry.Supported versions of PythonPython 3.4+