pykakasi is a Python Natural Language Processing (NLP) library that transliterates Japanese text (hiragana, katakana, and kanji) into rōmaji (Latin/Roman alphabet). It supports NFC-normalized characters and is based on the C-language kakasi library. The current version is 2.3.0, and while there isn't a strict release cadence, updates are made as needed.
pip install pykakasiVerified import paths — ran on the pinned version, not inferred.
Initializes the kakasi converter and demonstrates both the deprecated (v1.x) and the recommended (v2.x) API for converting Japanese text into romaji, hiragana, and katakana. The new API offers a more streamlined `convert()` method.
Rewrite code using `kakasi().convert(text)` for conversion. For custom options, `kakasi` can be configured before calling `convert` or by passing a dictionary of options to its constructor (refer to official docs for full options).
Review your project's licensing requirements. If GPLv3+ is incompatible, consider alternative Japanese romanization libraries with more permissive licenses (e.g., MIT or BSD).
Ensure input text is normalized to NFC before processing with pykakasi, e.g., using `unicodedata.normalize('NFC', text)`.Use `https://codeberg.org/miurahr/pykakasi` as the primary source for the project, documentation, and issue tracking.
Be aware of the potential for slower maintenance. For mission-critical applications requiring active development or immediate support, evaluate the project's current activity or consider alternatives.
Install the library using pip: `pip install pykakasi` or `conda install -c conda-forge pykakasi` if using Anaconda/Miniconda.
Correctly instantiate the `kakasi` class: `import pykakasi; kks = pykakasi.kakasi()`
Migrate your code to use the modern API, specifically the `kakasi().convert(text)` method for transliteration. For example: `import pykakasi; kks = pykakasi.kakasi(); result = kks.convert(text)`
Ensure you have a modern Python environment (Python 3.8+ is officially supported by pykakasi v2.3.0). If the issue persists, try installing `nose` separately before installing pykakasi: `pip install nose` or consider upgrading pip itself. Alternatively, installing from a reliable package manager like conda-forge (`conda install -c conda-forge pykakasi`) might resolve dependency issues.