JMdictPy
Fast Python wrapper for jmdict-simplified with SQLite backend and automatic updates.
Features
- 🚀 Fast lookups - SQLite with indexed queries (sub-millisecond)
- 🔄 Auto-updates - Checks for new releases on initialization
- 🌍 Multi-language - Supports 10 languages (eng, ger, rus, hun, dut, spa, fre, swe, slv)
- 📦 Zero config - Downloads and builds database automatically
- 🔍 Full-text search - FTS5 for meaning/gloss searches
- 📚 Complete coverage - JMdict, JMnedict (names), Kanjidic (characters)
Installation
pip install jmdictpy
Or install from source:
git clone https://github.com/your-username/jmdictpy
cd jmdictpy
pip install -e .
Quick Start
from jmdictpy import JMDict
# Initialize (downloads ~11MB on first run)
jmd = JMDict()
# Lookup by kanji/kana
result = jmd.lookup("食べる")
for entry in result.entries:
print(entry)
# 食べる【たべる】: to eat; to live on
# Lookup by reading
entries = jmd.lookup_by_reading("たべる")
# Search by meaning (full-text search)
entries = jmd.search("to eat")
# Lookup kanji character
char = jmd.lookup_character("食")
print(f"{char.literal}: {char.meanings}")
# 食: ['eat', 'food']
# Lookup names (JMnedict)
names = jmd.lookup_name("田中")
API Reference
JMDict Class
JMDict(
db_path=None, # Custom database path (default: ~/.jmdictpy/jmdict.db)
language="eng", # Translation language
auto_update=True, # Check for updates on init
memory_mode=False, # Load DB into RAM for faster queries
common_only=False, # Only download common words
)
Methods
| Method | Description |
|---|---|
lookup(query) |
Main search - finds entries by kanji, kana, or meaning |
lookup_by_reading(reading) |
Search by kana reading only |
lookup_by_meaning(meaning) |
Exact match on translation |
search(query) |
Full-text search on meanings |
lookup_by_id(id) |
Get entry by JMdict ID |
lookup_name(text) |
Search JMnedict for names |
lookup_character(char) |
Get Kanjidic info for a kanji |
check_for_updates() |
Check if new version available |
update() |
Download and install latest version |
Data Models
@dataclass
class Entry:
id: str
kanji: list[Kanji] # Kanji writings
kana: list[Kana] # Kana readings
senses: list[Sense] # Meanings/translations
@dataclass
class Sense:
part_of_speech: list[str]
glosses: list[Gloss] # Translations
fields: list[str] # Field of use (math, comp, etc.)
dialect: list[str]
misc: list[str]
@dataclass
class LookupResult:
entries: list[Entry] # JMdict entries
names: list[NameEntry] # JMnedict names
characters: list[Character] # Kanjidic characters
Configuration
Environment Variables
| Variable | Description |
|---|---|
JMDICTPY_DATA_DIR |
Custom data directory (default: ~/.jmdictpy) |
Languages
Supported language codes (ISO 639-2):
eng- Englishger- Germanrus- Russianhun- Hungariandut- Dutchspa- Spanishfre- Frenchswe- Swedishslv- Slovenianall- All languages
Updates
JMdictPy checks for updates from jmdict-simplified releases automatically.
# Check current version
print(jmd.version) # 3.6.1+20251229123436
# Check for updates
local, remote, available = jmd.check_for_updates()
# Update to latest
jmd.update()
License
MIT License
Dictionary data from JMdict by the Electronic Dictionary Research and Development Group, used under EDRDG License.
Metadata
Release files for jmdictpy 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jmdictpy-0.1.1.tar.gz | 15.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jmdictpy-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 32.5 kB
Release files / jmdictpy-0.1.1.tar.gz
| Download URL | jmdictpy-0.1.1.tar.gz |
|---|---|
| Size | 15.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5ca6a63e10796750b64a22e5741bf1eb05d20731d8a6edb35f68667347406f16
|
|
BLAKE2b-256 checksum How to use checksums |
106cf443184a67ba06b6ec88b6cc1801ad88eff1d9c29f620f80fb40d8698312
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 30, 2025.
Transparency logRelease files / jmdictpy-0.1.1-py3-none-any.whl
| Download URL | jmdictpy-0.1.1-py3-none-any.whl |
|---|---|
| Size | 17.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f63b2379cedcf6c64a0f0aa08d624343634f8a75382c099804ead45c12e19f11
|
|
BLAKE2b-256 checksum How to use checksums |
10b144621865be17ca36a3dff61e6827d4e7fe1297cdd341b1f42e7741e30297
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 30, 2025.
Transparency log