Fastest Korean Hangul syllable and jamo manipulation library (meta-package)
Project description
fast-hangeul-jamo
A fast, optimized Korean Hangul syllable and jamo manipulation library for Python.
This is a meta-package that provides a unified interface for Korean Hangul processing with two implementation backends:
- Pure Python (
hangeul-jamo-py): Default, pure Python implementation - works everywhere - Rust-accelerated (
hangeul-jamo-rs): High-performance Rust implementation with Python bindings
Installation
Basic Installation (Pure Python)
pip install fast-hangeul-jamo
This installs the pure Python implementation, which works on all platforms without requiring compilation.
High-Performance Installation (Rust)
pip install fast-hangeul-jamo[rust]
This installs both implementations, with the Rust version taking priority for better performance.
Usage
from fast_hangeul_jamo import compose, decompose
# Compose jamo into syllables
syllable = compose('ㄱ', 'ㅏ', 'ㅁ') # -> '감'
# Decompose syllables into jamo
jamos = decompose('한글') # -> [('ㅎ', 'ㅏ', 'ㄴ'), ('ㄱ', 'ㅡ', 'ㄹ')]
# Check which implementation is being used
from fast_hangeul_jamo import _implementation
print(_implementation) # 'rust' or 'python'
The API is identical regardless of which backend is installed.
Implementation Details
hangeul-jamo-py (Pure Python)
- ✅ Works on all platforms
- ✅ No compilation required
- ✅ Easy to debug
hangeul-jamo-rs (Rust)
- ✅ 2-5x faster performance than python implementation
- ✅ Memory efficient
- ✅ Type-safe Rust implementation
Backend Selection
The package automatically selects the best available implementation:
- If
hangeul-jamo-rsis installed → use Rust implementation - Otherwise → use
hangeul-jamo-py(pure Python)
You can check which implementation is active:
from fast_hangeul_jamo import _implementation
print(f"Using {_implementation} implementation")
Performance Comparison
📊 Performance Ratio Analysis (vs slowest)
| Category | Slowest | jamo | hangul-jamo | hangeul_jamo_py | hangeul_jamo_rs |
|---|---|---|---|---|---|
| Single Syllable Decompose | jamo | 1.00x (slowest) | 2.15x faster | 3.33x faster | 7.91x faster |
| Short Text Decompose | jamo | 1.00x (slowest) | 1.33x faster | 4.58x faster | 14.62x faster |
| Medium Text Decompose | jamo | 1.00x (slowest) | 1.16x faster | 5.24x faster | 31.05x faster |
| Large Text Decompose | jamo | 1.00x (slowest) | 1.12x faster | 6.81x faster | 36.92x faster |
| Single Syllable Compose | jamo | 1.00x (slowest) | 39.01x faster | 26.69x faster | 52.54x faster |
| Short Text Compose | hangul-jamo | N/A | 1.00x (slowest) | 4.63x faster | 32.52x faster |
| Validation Syllable | hangul-jamo | 1.25x faster | 1.00x (slowest) | 1.24x faster | 1.81x faster |
| Roundtrip | hangul-jamo | N/A | 1.00x (slowest) | 4.32x faster | 22.03x faster |
Source by hangeul_jamo_benchmark
Contributing
This is a meta-package. For implementation issues:
- Pure Python implementation: hangeul-jamo-py
- Rust implementation: hangeul-jamo-rs
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fast_hangeul_jamo-0.1.1.tar.gz.
File metadata
- Download URL: fast_hangeul_jamo-0.1.1.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2504068a2c0380ef01f34af9c7375906e3938ead3166e0e1e0f700c0506c2d47
|
|
| MD5 |
d8100f3e1b1bd4fa6547b7daedb81938
|
|
| BLAKE2b-256 |
fe2cf9109118e294ea33469498c3b4205129a39a351f9cd121e7d2039e77d4a7
|
File details
Details for the file fast_hangeul_jamo-0.1.1-py3-none-any.whl.
File metadata
- Download URL: fast_hangeul_jamo-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24516fe0e039ad857e6f8356a902e73f6aa1d645924b4ddbe58ad7cd49a50a56
|
|
| MD5 |
46e0a344398dac3611d19dea179d93f2
|
|
| BLAKE2b-256 |
44f31c92166c38dce3a779e88c51b1d212e646fae253e63da01658fba8b1325b
|