konoha
Add your description here
What it is and what it does
Konoha is a wrapper library that abstracts away the differences between multiple Japanese tokenizers, allowing you to write tokenization code once and swap tokenizers by changing a single parameter. It supports word-level tokenization (via MeCab, Janome, Sentencepiece, and others), sentence-level splitting with customizable delimiters and bracket handling, and rule-based tokenizers for simple cases. The library also includes optional remote file support for loading dictionaries and models from Amazon S3.
You use it by instantiating a WordTokenizer or SentenceTokenizer with your chosen backend, then calling tokenize() on your input text. It's designed for preprocessing pipelines in Japanese NLP tasks where you might want to experiment with different tokenizers or deploy with a specific one. The package also exposes a REST API via Docker for tokenization as a service.
Use it for:
- Switching between MeCab and Janome during development to compare tokenization quality without rewriting preprocessing code.
- Building a Japanese NLP preprocessing pipeline that can use different tokenizers in different environments (dev, test, production).
- Sentence-level splitting of Japanese text with custom punctuation and bracket rules for downstream analysis.
- Deploying a tokenization microservice via Docker for multiple applications to call over HTTP.
- Loading tokenizer models and dictionaries from S3 in cloud-based NLP workflows.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Konoha provides a unified Python interface to multiple Japanese tokenizers (MeCab, Janome, Sentencepiece, and others), plus rule-based tokenizers and sentence splitters, letting you switch between them without rewriting your code.
Yes, if you work with Japanese text and want flexibility in tokenizer choice. The low install friction, active maintenance, MIT license, and zero known vulnerabilities make it a safe dependency. Install with a specific tokenizer extra (e.g., `konoha[mecab]`) unless you plan to choose at runtime; the base package alone won't tokenize without an underlying tokenizer installed.
Install
konoha on PyPI
pip
pip install konohauv
uv add konohapoetry
poetry add konohaInstalling konoha
Before you install
Low friction: pure Python wheel with only requests as a runtime dependency. Actively maintained as of March 2026. Requires Python 3.10 or later.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Quickstart
pip install konoha
from konoha import WordTokenizer
tokenizer = WordTokenizer('MeCab')
print(tokenizer.tokenize('自然言語処理を勉強しています'))
Requires Python 3.10 or later. The underlying tokenizer (MeCab, Janome, etc.) must be installed separately or via extras (e.g., pip install 'konoha[mecab]').
Verify before relying
- Whether all advertised tokenizers (MeCab, Janome, Sentencepiece) are equally well-maintained and tested.
- Performance characteristics and tokenization accuracy compared to using tokenizers directly.
- Whether the Docker-based API server is actively maintained and production-ready.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — requests |
| Maintenance | actively maintained — 166 days since the last release |
| First released | |
| Downloads | 156,907/month — #10,772 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: konoha-5.7.0-py3-none-any.whl
Tags
More Linguistic packages
Detects and normalizes text encoding from…
permissive · top 100 on PyPI
tiktokentiktoken is a fast BPE tokenizer that converts…
permissive · top 1,000 on PyPI
chardetDetects character encoding and language in byte…
permissive · top 1,000 on PyPI
text-unidecodeConverts Unicode text to ASCII by…
copyleft · top 1,000 on PyPI
larkLark is a parsing library that builds abstract…
permissive · top 1,000 on PyPI
tree-sitterPython bindings to the tree-sitter parsing…
permissive · top 1,000 on PyPI
JanomeJanome is a Japanese morphological analyzer…
permissive · top 15,000 on PyPI
mecabPython binding for MeCab, a morphological…
copyleft · top 15,000 on PyPI
fugashiA Cython wrapper for MeCab that tokenizes and…
permissive · top 5,000 on PyPI
mecab-python3Python wrapper for MeCab, a morphological…
permissive · top 5,000 on PyPI
ipadicProvides the IPAdic Japanese morphological…
unclear · top 15,000 on PyPI
mecab-ko-dicProvides a Korean dictionary for MeCab…
unclear · top 15,000 on PyPI
curated-tokenizersProvides BPE, Byte BPE, Unigram, and Wordpiece…
permissive · top 5,000 on PyPI
unidicProvides the UniDic 2.3.0 Japanese…
permissive · top 15,000 on PyPI
SudachiPySudachiPy is a Python binding for Sudachi.rs, a…
permissive · top 5,000 on PyPI
sentencepieceSentencePiece is an unsupervised text tokenizer…
permissive · top 1,000 on PyPI