skillfed

mojimoji

A fast converter between Japanese hankaku and zenkaku characters

mojimoji v0.0.13 375.1K downloads/30d#7,141 on PyPI152
Permissive license DORMANT released

What it is and what it does

mojimoji is a Cython-based library for converting Japanese text between hankaku (half-width) and zenkaku (full-width) character forms. It provides two main functions: zen_to_han() converts full-width characters to half-width, and han_to_zen() does the reverse. Both functions accept optional flags to control whether kana, digits, and ASCII characters are converted, allowing fine-grained control over which character classes are affected.

The package is designed for speed and has no runtime dependencies, installing via pre-built wheels for Python 3.7–3.12 on major platforms. Maintenance is dormant (last release 2024-01-12), but the codebase is stable and the repository remains accessible.

Use it for:

  • Normalize Japanese user input in web forms or data pipelines to a consistent character width.
  • Prepare Japanese text for search indexing or matching where width variations should be treated as equivalent.
  • Convert legacy half-width Japanese data to full-width for display or compatibility with modern systems.
  • Process Japanese text in NLP or text analysis workflows where character width normalization is a preprocessing step.
  • Handle Japanese text in databases or APIs where width consistency is required for data integrity.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Converts Japanese text between hankaku (half-width) and zenkaku (full-width) character representations using Cython for speed.

Yes, if you need to convert between Japanese character widths. The package is stable, dependency-free, and widely used. The dormant maintenance is not a blocker for a mature, single-purpose tool with no external dependencies. Install it if Japanese text normalization is part of your workflow; skip it if you don't work with Japanese text.

Install

mojimoji on PyPI

pip

pip install mojimoji

uv

uv add mojimoji

poetry

poetry add mojimoji

Installing mojimoji

Before you install

Medium install friction due to compiled wheels; pre-built binaries available for Python 3.7–3.12 on macOS, Linux, and Windows, so installation should succeed without compilation on most platforms. Maintenance is dormant—last release was 2024-01-12, though the repository remains active and the package is stable.

License in practice

Licensed under Apache License (permissive), so you can use, modify, and distribute the package freely with minimal restrictions.

Quickstart

pip install mojimoji

import mojimoji
print(mojimoji.zen_to_han('アイウabc012'))
# Output: アイウabc012
print(mojimoji.han_to_zen('アイウabc012'))
# Output: アイウabc012

Requires Python 3.7 or later; installation relies on pre-built wheels for common platforms.

Verify before relying

  • Whether the package handles combining characters or other Unicode edge cases in Japanese text.
  • Performance characteristics on very large text volumes or streaming scenarios.
  • Whether dormant maintenance affects long-term compatibility with future Python versions beyond 3.12.
  • Current adoption and usage patterns in production systems.

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.7)
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance dormant — 945 days since the last release
Last repo commit
First released
Downloads 375,150/month — #7,141 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: mojimoji-0.0.13-cp310-cp310-macosx_10_9_x86_64.whl; mojimoji-0.0.13-cp310-cp310-macosx_11_0_arm64.whl; mojimoji-0.0.13-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl; mojimoji-0.0.13-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; mojimoji-0.0.13-cp310-cp310-win32.whl; mojimoji-0.0.13-cp310-cp310-win_amd64.whl; mojimoji-0.0.13-cp311-cp311-macosx_10_9_x86_64.whl; mojimoji-0.0.13-cp311-cp311-macosx_11_0_arm64.whl; mojimoji-0.0.13-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl; mojimoji-0.0.13-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; mojimoji-0.0.13-cp311-cp311-win32.whl; mojimoji-0.0.13-cp311-cp311-win_amd64.whl; mojimoji-0.0.13-cp312-cp312-macosx_10_9_x86_64.whl; mojimoji-0.0.13-cp312-cp312-macosx_11_0_arm64.whl; mojimoji-0.0.13-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl; mojimoji-0.0.13-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; mojimoji-0.0.13-cp312-cp312-win32.whl; mojimoji-0.0.13-cp312-cp312-win_amd64.whl; mojimoji-0.0.13-cp37-cp37m-macosx_10_9_x86_64.whl; mojimoji-0.0.13-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl

Keywords: japanese

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseNatural Language :: JapaneseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

japanese character width conversionhankaku zenkaku converterjapanese text normalizationhalf-width full-width japanesejapanese character transformationzen to han conversionjapanese text processing
japanese-textcharacter-encoding

More Linguistic packages