Parses a Wiktionary database dump into a Migaku Dictionary (Anki add-on).
Before running the application, you need to setup the environment. We recommend using pyenv as part of that setup.
pyenv virtualenv 3.8.3 migaku_wiktionary
pyenv activate migaku_wiktionary
pip install -r requirements.txt
python cli.py --help
python cli.py --lang de download
python cli.py --xml /tmp/dewiktionary-*.xml convert
To install one of the exported dictionaries into the Anki's add-on, run the following snippet:
time python cli.py --xml data/dewiktionary-latest-pages-meta-current.xml convert
export DICTIONARY_PATH=~/Library/Application\ Support/Anki2/addons21/Migaku\ Dictionary/user_files/dictionaries/German/de_deutsch
mkdir -p $DICTIONARY_PATH
cp /tmp/de_deutsch.json $DICTIONARY_PATH/de_deutsch.json
The project is backed by a test suite. Run it with the following command:
pip install -r requirements-dev.txt
pytest -vv --cov=migaku_wiktionary