Registry / data / jamo
library0.4.1pypypi✓ verified 84d ago

Jamo is a Python library designed for the decomposition and synthesis of Hangul syllables into their constituent jamo characters. It supports both the U+11xx jamo characters and Hangul Compatibility Jamo (HCJ, U+31xx) for display purposes. Currently in beta release (version 0.4.1), the library primarily focuses on modern Hangul. While releases are sporadic, the project is actively maintained, with documentation reflecting the 0.4-beta interface.

pip install jamo
INSTALL
IMPORT
SIG · JAMO
J
jamo
datapythonv0.4.1
Install
1.5s avg
Import
9ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.4.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.010s · 17.8MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 1.5s · import 0.007s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

h2j
from jamo import h2j
For decomposing Hangul syllables into U+11xx jamo characters.
j2h
from jamo import j2h
For synthesizing Hangul syllables from U+11xx jamo characters.
j2hcj
from jamo import j2hcj
For converting U+11xx jamo to Hangul Compatibility Jamo (HCJ, U+31xx) for better display.
hcj2j
from jamo import hcj2j
For converting Hangul Compatibility Jamo (HCJ) to U+11xx jamo.
get_jamo_class
from jamo import get_jamo_class
To determine if a jamo character is a 'lead', 'vowel', or 'tail' consonant.
jamo.hangul_to_jamo
from jamo import jamo jamo.hangul_to_jamo("한글")
Direct imports like `from jamo import h2j` are preferred in current documentation.

This quickstart demonstrates how to decompose Hangul syllables into jamo characters, convert them to Hangul Compatibility Jamo (HCJ) for display, and synthesize Hangul syllables back from individual jamo.

from jamo import h2j, j2h, j2hcj # Hangul Decomposition (to U+11xx jamo) hangul_text = "안녕하세요" decomposed_jamo = h2j(hangul_text) print(f"Decomposed (U+11xx): {decomposed_jamo}") # Convert U+11xx jamo to Hangul Compatibility Jamo (HCJ) for display display_jamo = j2hcj(decomposed_jamo) print(f"Decomposed (HCJ): {display_jamo}") # Hangul Synthesis lead = 'ㅇ' vowel = 'ㅏ' tail = 'ㄴ' synthesized_hangul = j2h(lead, vowel, tail) print(f"Synthesized: {synthesized_hangul}") # Using splat operator for synthesis from a string of jamo jamo_string = 'ㅇㅏㄴ' synthesized_from_string = j2h(*jamo_string) print(f"Synthesized from string: {synthesized_from_string}")
Debug
Known issues
breakingFunction names and module interfaces underwent significant changes between versions 0.3 and 0.4.0 (e.g., `j2h` vs. `jamo_to_hangul`), which may break older codebases.
fix
Refer to the 0.4-beta documentation for updated function names and usage patterns.
affects: 0.3.x to 0.4.x
gotchaThe `get_jamo_class` function is designed for U+11xx jamo characters and will raise an `InvalidJamoError` if passed Hangul Compatibility Jamo (HCJ) consonants, as they are ambiguous in class.
fix
Ensure input to `get_jamo_class` is a U+11xx jamo character. If you have HCJ, consider converting it first using `hcj2j` (with `position` argument where necessary).
affects: 0.4.x
deprecatedThe string return value of `get_jamo_class` ('lead', 'vowel', 'tail') is currently under consideration for change in future versions.
fix
Monitor future release notes for potential changes to the return type of `get_jamo_class` and update parsing logic accordingly.
affects: 0.4.x
gotchaWhen converting Hangul Compatibility Jamo (HCJ) to U+11xx jamo using `hcj2j`, you *must* provide the `position` argument (e.g., 'lead', 'vowel', 'tail') for consonant characters to resolve ambiguity.
fix
Always specify `position` when calling `hcj2j` with consonant HCJ characters, e.g., `hcj2j('ㅇ', 'lead')` vs `hcj2j('ㅇ', 'tail')`.
affects: 0.4.x
gotchaU+11xx jamo characters may have display issues depending on the font and environment. It is often recommended to convert them to Hangul Compatibility Jamo (HCJ) using `j2hcj` for more uniform and reliable display.
fix
Use `j2hcj(h2j(text))` to get HCJ output for better font compatibility and display.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'jamo'
The 'jamo' library has not been installed in the Python environment, or the Python interpreter cannot locate the installed package.
fix
Install the jamo library using pip: `pip install jamo`
jamo.jamo.InvalidJamoError: Invalid or classless jamo argument.
This error occurs when attempting to use the `get_jamo_class` function with Hangul Compatibility Jamo (HCJ, U+31xx) consonant characters. The function is designed for U+11xx jamo characters and finds HCJ consonants ambiguous.
fix
Ensure that the input to `get_jamo_class` is a U+11xx jamo character. If you have HCJ, convert it to U+11xx jamo first using `hcj2j` (specifying the position for consonants).
TypeError: hcj2j() missing 1 required positional argument: 'position'
When converting Hangul Compatibility Jamo (HCJ) consonants to U+11xx jamo using `hcj2j`, the `position` argument ('lead', 'vowel', or 'tail') is mandatory to resolve ambiguity, but it was not provided.
fix
Always specify the `position` argument when calling `hcj2j` with consonant HCJ characters. For example, `hcj2j('ㅇ', 'lead')` or `hcj2j('ㅇ', 'tail')`.
AttributeError: module 'jamo' has no attribute 'decompose'
The 'decompose' and 'compose' functions are located within the 'jamo.jamo' submodule, not directly under the 'jamo' package.
fix
from jamo.jamo import decompose
decompose('한')
AttributeError: module 'jamo' has no attribute 'h2jamo'
The function name 'h2jamo' is incorrect. The proper function for converting Hangul to Jamo characters is 'h2j'.
fix
from jamo import h2j
h2j('안녕하세요')
Upgrade
Version history
0.4.1latest on PyPI · released Nov 6, 2017
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Amazon
1
Resources