Installation

jamdict and jamdict dictionary data are both available on PyPI and can be installed using pip.

pip install --user jamdict jamdict-data
# pip script sometimes doesn't work properly
# so you may want to try this instead
python3 -m pip install jamdict jamdict-data

Note

When you use pip install in a virtual environment, especially the ones created via python3 -m venv, wheel support can be missing. jamdict-data relies on wheel/pip to extract xz-compressed database and this may cause a problem. If you encounter any error, please make sure that wheel is available

# list all available packages in pip
pip list
# ensure wheel support in pip
pip install -U wheel

You may need to uninstall jamdict-data before reinstalling it.

pip uninstall jamdict-data

Download database file manually

This should not be useful anymore from version 0.1a8 with the release of the jamdict_data package on PyPI. If for some reason you want to download and install jamdict database by yourself, here are the steps:

  1. Download the offical, pre-compiled jamdict database (jamdict-0.1a7.tar.xz) from Google Drive https://drive.google.com/drive/u/1/folders/1z4zF9ImZlNeTZZplflvvnpZfJp3WVLPk

  2. Extract and copy jamdict.db to jamdict data folder (defaulted to ~/.jamdict/data/jamdict.db)

  3. To know where to copy data files you can use python3 -m jamdict info command via a terminal:

python3 -m jamdict info
# Jamdict 0.1a8
# Python library for manipulating Jim Breen's JMdict, KanjiDic2, KRADFILE and JMnedict
#
# Basic configuration
# ------------------------------------------------------------
# JAMDICT_HOME             : ~/local/jamdict
# jamdict_data availability: False
# Config file location     : /home/tuananh/.jamdict/config.json
#
# Custom Data files
# ------------------------------------------------------------
# Jamdict DB location: ~/local/jamdict/data/jamdict.db - [OK]
# JMDict XML file    : ~/local/jamdict/data/JMdict_e.gz - [OK]
# KanjiDic2 XML file : ~/local/jamdict/data/kanjidic2.xml.gz - [OK]
# JMnedict XML file : ~/local/jamdict/data/JMnedict.xml.gz - [OK]
#
# Others
# ------------------------------------------------------------
# lxml availability: False

Build database file from source

Normal users who just want to look up the dictionaries do not have to do this. If you are a developer and want to build jamdict database from source, copy the dictionary source files to jamdict data folder. The original XML files can be downloaded either from the official website https://www.edrdg.org/ or from this jamdict Google Drive folder.

To find out where to copy the files or whether they are recognised by jamdict, you may use the command python3 -m jamdict info as in the section above.

You should make sure that all files under the section Custom data files are all marked [OK]. After that you should be able to build the database with the command:

python3 -m jamdict import

Note on XML parser: jamdict will use lxml instead of Python 3 default xml when it is available.