jitendex-py
Parse Jitendex dictionary files for Yomitan (JSON) and convert HTML-structured content to semantic dictionaries.
Useful if you want to use Jitendex without parsing mdict format files.
Installation
pip install jitendex-py
If you are using uv,
uv add jitendex-py
Quick Start
from jitendex_py import parse_terms
# Parse from JSON string
with open('term_bank.json', 'r', encoding='utf-8') as f:
data = f.read()
terms = parse_terms(data)
# Parse from file object
with open('term_bank.json', 'r', encoding='utf-8') as f:
terms = parse_terms(f)
# Process results
for term in terms:
print(f"{term['text']} [{term['reading']}]: {len(term['definitions'])} definitions")
Input Format
Accepts Yomitan term bank v3 JSON files with entries as 8-element arrays:
[
["text", "reading", "def_tags", "rules", score, [definitions], sequence, "term_tags"],
...
]
Output Format
Returns list of dictionaries:
{
"text": str | None, # Headword
"reading": str | None, # Reading (kana)
"definition_tags": [str], # Tags split by whitespace
"rules": [str], # Inflection rules
"score": int, # Priority score
"definitions": [dict], # Parsed definitions
"sequence": int, # Entry ID
"term_tags": [str] # Term-level tags
}
Definition Types
Definitions can be one of:
Text:
{"type": "text", "content": "gloss text"}
Structured (HTML stripped):
{
"type": "structured",
"content": [
{"type": "sense-group", "content": [...]},
{"type": "part-of-speech-info", "tag": "noun", "code": "n", "content": "n"},
{"type": "glossary", "content": "gloss text"},
{"type": "cross-reference", "href": "?query=...", "text": "見る"}
]
}
Image:
{"type": "image", "path": "image.png", "width": 100, "height": 200}
Deinflection:
{
"type": "deinflection",
"source_term": "食べた",
"source_rules": "past",
"inflection_rules": "v1",
"definition": {...}
}
Features
- HTML stripping: Converts HTML tags to semantic types (
sense-group,glossary,part-of-speech-info, etc.) - Ruby parsing: Extracts kanji readings from
<ruby>annotations as一(いち) - Cross-references: Internal links (
?query=...) become structured references - Flexible input: Accepts JSON strings or file objects
Example: Processing Entries
from jitendex_py import parse_terms
with open('term_bank.json', 'r', encoding='utf-8') as f:
terms = parse_terms(f)
# Extract glossary
for term in terms:
text = term['text']
for def_obj in term['definitions']:
if def_obj['type'] == 'structured':
content = def_obj['content']
if isinstance(content, list):
for item in content:
if item.get('type') == 'glossary':
print(f"{text}: {item['content']}")
License
MIT License
Copyright (c) 2026 Perch Labs Pte Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Metadata
Release files for jitendex-py 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| jitendex_py-0.1.0.tar.gz | 5.4 kB | Without provenance | Details for jitendex_py-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| jitendex_py-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for jitendex_py-0.1.0-py3-none-any.whl |
Total release size: 11.7 kB
Release files / jitendex_py-0.1.0.tar.gz
| Download URL | jitendex_py-0.1.0.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9eea1d02eaec22efb186c83b3ec8aa7ccc51b6218c72383be947867a4eb6992a
|
|
BLAKE2b-256 checksum How to use checksums |
c0838ab61c05a16ff619d706a2e57b557d950cdfc25bca590526ddd734fc9530
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.6
|
Release files / jitendex_py-0.1.0-py3-none-any.whl
| Download URL | jitendex_py-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3e83385c047cf59af62fc2c000dc8cf352fcd10cf5c2f4a96b8d162dd2d36892
|
|
BLAKE2b-256 checksum How to use checksums |
9dea373299e29566687061d535a7d8192898a99cb62564026626bdb051dfeb4d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.6
|
Security for jitendex-py 0.1.0
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.