habachen
Yet Another Fast Japanese String Converter
What it is and what it does
Habachen is a Japanese text conversion library that handles transformations between full-width (zenkaku) and half-width (hankaku) characters, as well as conversions between hiragana and katakana scripts. It is written as a compiled extension and designed for speed and minimal memory overhead, making it suitable for processing large volumes of Japanese text.
The package provides straightforward functions like `han_to_zen()`, `zen_to_han()`, `to_katakana()`, and `to_hiragana()`, each with optional parameters to selectively convert only specific character types (ASCII, digits, or kana). It supports Python 3.8 through 3.14, including the No-GIL mode introduced in Python 3.14, and offers pre-built wheels for macOS, Linux, and Windows across multiple architectures.
Use it for:
- Normalize user input in Japanese web forms or search boxes by converting mixed-width characters to a standard form.
- Prepare Japanese text for natural language processing pipelines that require consistent character width or script representation.
- Convert hiragana-heavy user-generated content to katakana for consistency with technical or formal documentation standards.
- Batch-process large Japanese text corpora (e.g., historical documents, news archives) where performance and memory efficiency matter.
- Build Japanese text preprocessing steps in machine learning workflows where character normalization is a prerequisite.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Habachen converts between full-width and half-width characters, and between hiragana and katakana in Japanese text, with a focus on speed and low memory usage.
Yes, if you work with Japanese text and need fast, reliable character and script conversions. The library is stable (MIT-licensed, no known vulnerabilities), has no runtime dependencies, and offers measurably faster performance than comparable alternatives. The aging maintenance status (310 days since last release) is a minor concern but not a blocker—the repository is still active and the package is feature-complete for its narrow scope. Install if Japanese text normalization is a real requirement; skip if you only need occasional conversions or don't work with Japanese.
Install
habachen on PyPI
pip
pip install habachenuv
uv add habachenpoetry
poetry add habachenInstalling habachen
Before you install
Medium install friction due to compiled wheels for multiple platforms and Python versions (3.8–3.14). The package is aging—last release was 310 days ago—but the repository remains active with a recent commit on 2025-10-26, suggesting maintenance is ongoing rather than abandoned.
License in practice
MIT license is permissive; you can use, modify, and distribute habachen with minimal restrictions, making it suitable for both open-source and commercial projects.
Quickstart
pip install habachen
import habachen
# Convert half-width to full-width
result = habachen.han_to_zen('abc!?012ハンカクモジ')
print(result) # 'abc!?012ハンカクモジ'
# Convert hiragana to katakana
result = habachen.to_katakana('もじれつの変換')
print(result) # 'モジレツノ変換'
Verify before relying
- Whether the Free-threading (No-GIL) support in v0.6.0 is production-ready or still experimental.
- Current maintenance cadence and likelihood of future updates beyond bug fixes.
- Performance characteristics on very large documents or streaming use cases.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | aging — 310 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 126,850/month — #11,762 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: habachen-0.6.0-cp310-cp310-macosx_10_9_universal2.whl; habachen-0.6.0-cp310-cp310-macosx_10_9_x86_64.whl; habachen-0.6.0-cp310-cp310-macosx_11_0_arm64.whl; habachen-0.6.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl; habachen-0.6.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; habachen-0.6.0-cp310-cp310-musllinux_1_2_aarch64.whl; habachen-0.6.0-cp310-cp310-musllinux_1_2_x86_64.whl; habachen-0.6.0-cp310-cp310-win32.whl; habachen-0.6.0-cp310-cp310-win_amd64.whl; habachen-0.6.0-cp311-cp311-macosx_10_9_universal2.whl; habachen-0.6.0-cp311-cp311-macosx_10_9_x86_64.whl; habachen-0.6.0-cp311-cp311-macosx_11_0_arm64.whl; habachen-0.6.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl; habachen-0.6.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; habachen-0.6.0-cp311-cp311-musllinux_1_2_aarch64.whl; habachen-0.6.0-cp311-cp311-musllinux_1_2_x86_64.whl; habachen-0.6.0-cp311-cp311-win32.whl; habachen-0.6.0-cp311-cp311-win_amd64.whl; habachen-0.6.0-cp312-cp312-macosx_10_13_universal2.whl; habachen-0.6.0-cp312-cp312-macosx_10_13_x86_64.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
jaconvjaconv converts between Japanese character…
permissive · top 5,000 on PyPI
mojimojiConverts Japanese text between hankaku…
permissive · top 15,000 on PyPI
kanjizeConverts between Japanese kanji number…
permissive · top 15,000 on PyPI
pykakasiTransliterates Japanese text (hiragana,…
copyleft · top 5,000 on PyPI
misakiConverts written text to phonetic…
permissive · top 15,000 on PyPI
anyasciiConverts Unicode text to ASCII-only equivalents…
permissive · top 5,000 on PyPI
wetextNormalizes and denormalizes text in Chinese,…
permissive · top 15,000 on PyPI
fold-to-asciiConverts Unicode characters outside the basic…
permissive · top 15,000 on PyPI
pyopenjtalkWraps OpenJTalk to provide Japanese…
permissive · top 15,000 on PyPI
unidicProvides the UniDic 2.3.0 Japanese…
permissive · top 15,000 on PyPI