skillfed

konoha

Add your description here

konoha v5.7.0 156.9K downloads/30d#10,772 on PyPI
Permissive license MIT Active released

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 konoha

uv

uv add konoha

poetry

poetry add konoha

Installing 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

japanese tokenizer wrapperswitch between japanese tokenizersjapanese nlp preprocessingmecab janome sentencepiece interfacejapanese sentence splitterjapanese word tokenizationunified japanese morphological analysis
japanese-nlptokenizationmorphological-analysis

More Linguistic packages