skillfed

habachen

Yet Another Fast Japanese String Converter

habachen v0.6.0 126.8K downloads/30d#11,762 on PyPI6
Permissive license MIT AGING released

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 habachen

uv

uv add habachen

poetry

poetry add habachen

Installing 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

Intended Audience :: DevelopersIntended Audience :: Science/ResearchNatural Language :: JapaneseProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: Text Processing :: Linguistic

Tags

japanese character width conversionhiragana katakana converterfull-width half-width conversionjapanese string normalizationfast japanese text processingjapanese character transformationzenkaku hankaku conversion
japanese-textcharacter-normalizationno-gil-ready

More Linguistic packages