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
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.010s · 17.8MB
glibcpy 3.10–3.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}")
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.
fixInstall 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.
fixEnsure 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.
fixAlways 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.
fixfrom 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'.
fixfrom jamo import h2j
h2j('안녕하세요') Upgrade
Version history
0.4.1latest on PyPI · released Nov 6, 2017
Audit
Dependencies
No dependency data recorded yet.