Skip to main content

hangulpy

PyPI Python CI License

조사 선택부터 자모 분해·조합, 초성 검색, 발음 변환, 로마자 표기까지 제공하는 Python 한글 처리 라이브러리입니다. es-hangul에서 영감을 받아 Python에 자연스러운 API와 타입 정보를 제공합니다.

  • 별도 런타임 의존성 없음
  • NFC·NFD와 호환 자모를 고려한 Unicode 처리
  • py.typed를 포함한 정적 타입 검사 지원
  • 조사, 검색, 숫자, 발음, 로마자 표기를 하나의 패키지에서 제공

설치

python -m pip install -U hangulpy
hangulpy Python 지원 정책
v1.4.x 3.8~3.14 3.14를 포함한 필수 CI 검증
v1.4.x 3.15 프리릴리스 실패를 허용하는 선행 호환성 검증
v1.5 이상 3.11 이상 다음 마이너 계열의 최소 버전

Python 3.8~3.10을 계속 사용해야 한다면 python -m pip install "hangulpy<1.5"로 마지막 호환 계열을 설치할 수 있습니다. 자세한 배경은 v1.5 마이그레이션 가이드를 확인하세요.

빠른 시작

from hangulpy import (
    extract_chosung,
    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(extract_chosung("한글"))  # ㅎㄱ

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, extract_chosung, can_be_jongsung
발음·표기 표준 발음 변환과 여러 방식의 로마자 표기 standardize_pronunciation, romanize, Romanizer
숫자·키보드 한글 수사 변환과 한영타 교정 number_to_hangul, susa, days, koen, enko, autofix

전체 공개 API와 사용법은 공식 문서에서 확인할 수 있습니다.

더 보기

개발과 기여

저장소를 받은 뒤 개발 의존성을 설치하고 검사할 수 있습니다.

python -m pip install -e ".[dev]"
python -m ruff check .
python -m black --check .
python -m pytest

버그 제보, 기능 제안, 문서 개선과 Pull Request를 환영합니다. 작업 전 열린 이슈를 확인해 주세요.

라이선스

MIT License

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hangulpy-1.4.2.tar.gz (56.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hangulpy-1.4.2-py3-none-any.whl (51.6 kB view details)

Uploaded Python 3

File details

Details for the file hangulpy-1.4.2.tar.gz.

File metadata

  • Download URL: hangulpy-1.4.2.tar.gz
  • Upload date:
  • Size: 56.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for hangulpy-1.4.2.tar.gz
Algorithm Hash digest
SHA256 90d5b08848c8f42b7417bb98c60541ca67af171cc097009543d9e220b6eeff6f
MD5 28de9f91430b75446ed1b70b4584a712
BLAKE2b-256 0c9e8d728f99b6a14e5c8f6cd4557c0fdcb44a7ec355993de2b98727d0d1efb0

See more details on using hashes here.

File details

Details for the file hangulpy-1.4.2-py3-none-any.whl.

File metadata

  • Download URL: hangulpy-1.4.2-py3-none-any.whl
  • Upload date:
  • Size: 51.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for hangulpy-1.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 33199c79fd3c9e64b55d2b66dbf43e3efa8078dd28d90a1fa52f4cb893127fa1
MD5 2123102d9c5f6a4a8fa8eaa9723739b5
BLAKE2b-256 1d00fdf1631d60465d614d40af90777c05c141e999ca47165ea78a978c3cfcb7

See more details on using hashes here.

Release history Release notifications | RSS feed

1.5.1

2 files

1.5.0

2 files

This release

1.4.2 This release

2 files

1.4.1

2 files

1.4.0

2 files

1.3.2

2 files

1.3.1

2 files

1.3.0

2 files

1.2.1

2 files

1.2.0

2 files

1.1.1

2 files

1.1.0

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page