hangulpy
조사 선택부터 자모 분해·조합, 초성 검색, 발음 변환, 로마자 표기까지 제공하는 Python 한글 처리 라이브러리입니다. es-hangul에서 영감을 받아 Python에 자연스러운 API와 타입 정보를 제공합니다.
- 별도 런타임 의존성 없음
- NFC·NFD, 호환 자모와 반각 한글을 고려한 Unicode 처리
py.typed를 포함한 정적 타입 검사 지원- 조사, 검색, 숫자, 발음, 로마자 표기를 하나의 패키지에서 제공
설치
python -m pip install -U hangulpy
| hangulpy | Python | 지원 정책 |
|---|---|---|
| v1.5.x | 3.11~3.14 | 필수 CI 검증 |
| v1.5.x | 3.15 프리릴리스 | 실패를 허용하는 선행 호환성 검증 |
| v1.4.x | 3.8~3.10 | 이전 Python용 호환 계열 |
Python 3.8~3.10을 계속 사용해야 한다면 python -m pip install "hangulpy<1.5"로
마지막 호환 계열을 설치할 수 있습니다. 자세한 배경은
v1.5 마이그레이션 가이드를 확인하세요.
빠른 시작
from hangulpy import (
get_chosung_string,
format_josa,
hangul_contains,
join_jamos,
number_to_hangul_mixed,
romanize,
split_syllables,
standardize_pronunciation,
)
print(format_josa("RAM[은/는] API[이/가]")) # RAM은 API가
print(hangul_contains("사과", "삭")) # True
print(split_syllables("한글", output_format="string")) # ㅎㅏㄴㄱㅡㄹ
print(join_jamos(["ㅎ", "ㅏ", "ㄴ", "ㄱ", "ㅡ", "ㄹ"])) # 한글
print(get_chosung_string("한글")) # ㅎㄱ
print(standardize_pronunciation("굳이")) # 구지
print(romanize("한글")) # hangeul
print(number_to_hangul_mixed(123456780)) # 1억2,345만6,780
주요 기능
| 분야 | 설명 | 주요 API |
|---|---|---|
| 조사 | 받침, 숫자, 영문 약어에 맞는 조사 선택 | josa, josa_pick, format_josa, has_batchim |
| 검색 | 초성·부분 음절·퍼지 검색과 원문 위치 추적 | hangul_contains, HangulSearcher, HangulIndex, find_hangul_spans |
| 자모 | 음절 분해·조합, 자모 단위 편집과 변환 | split_syllables, join_jamos, jamo_slice, map_hangul |
| 속성 | 초·중·종성 판정과 문자열 전체 성분 추출 | get_hangul_components, get_chosung_string, can_be_jongsung |
| 발음·표기 | 표준 발음 변환과 여러 방식의 로마자 표기 | standardize_pronunciation, romanize, Romanizer |
| 숫자·키보드 | 한글 수사 변환과 한영타 교정 | number_to_hangul, susa, days, koen, enko, autofix |
| 전처리 | 반각 한글 변환과 반복 자모·이모티콘 정리 | normalize_halfwidth_hangul, reduce_jamo_repeats |
전체 공개 API와 사용법은 공식 문서에서 확인할 수 있습니다.
더 보기
개발과 기여
저장소를 받은 뒤 개발 의존성을 설치하고 검사할 수 있습니다.
python -m pip install -e ".[dev]"
python -m ruff check .
python -m black --check .
python -m pytest
버그 제보, 기능 제안, 문서 개선과 Pull Request를 환영합니다. 작업 전 열린 이슈를 확인해 주세요.
라이선스
Metadata
Release files for hangulpy 1.5.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hangulpy-1.5.2.tar.gz | 64.7 kB | Without provenance | Details for hangulpy-1.5.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hangulpy-1.5.2-py3-none-any.whl | Python 3 | none | any | Details for hangulpy-1.5.2-py3-none-any.whl |
Total release size: 119.6 kB
Release files / hangulpy-1.5.2.tar.gz
| Download URL | hangulpy-1.5.2.tar.gz |
|---|---|
| Size | 64.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
738e5f071dba66b275093dd9ec925404d0294c27f6e0544289113a7fc2ef5485
|
|
BLAKE2b-256 checksum How to use checksums |
3126399435e80fd58783dfada1bdd99230ed8a6bfaf9cfa9e5ae1e387eaa4a1b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / hangulpy-1.5.2-py3-none-any.whl
| Download URL | hangulpy-1.5.2-py3-none-any.whl |
|---|---|
| Size | 55.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1aa1491998e62f6d439db8e4f62d6db5fb27001c93a02b88bfa1f95370d028b9
|
|
BLAKE2b-256 checksum How to use checksums |
46800623b57970a7e56805f571a0092c22297735f0f53f0cb45f295d60ab5820
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for hangulpy 1.5.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.