Metadata-Version: 2.4
Name: hangulpy
Version: 1.4.1
Summary: A comprehensive Python library for Korean language processing, inspired by es-hangul
Author-email: Jeong Gaon <gokirito12@gmail.com>
Maintainer-email: Jeong Gaon <gokirito12@gmail.com>
License: MIT License
        
        Copyright (c) 2024 gaon12
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/gaon12/hangulpy
Project-URL: Documentation, https://hangulpy.uiharu.dev
Project-URL: Repository, https://github.com/gaon12/hangulpy
Project-URL: Bug Tracker, https://github.com/gaon12/hangulpy/issues
Project-URL: Changelog, https://github.com/gaon12/hangulpy/releases
Keywords: korean,hangul,josa,particle,chosung,romanization,korean-language,nlp,text-processing
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Processing :: Linguistic
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest>=7.4.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: mypy<1.15,>=1.5.0; extra == "dev"
Requires-Dist: pyright<2,>=1.1.411; extra == "dev"
Requires-Dist: build>=1.2.0; extra == "dev"
Requires-Dist: twine>=5.0.0; extra == "dev"
Provides-Extra: test
Requires-Dist: pytest>=7.4.0; extra == "test"
Requires-Dist: pytest-cov>=4.1.0; extra == "test"
Provides-Extra: lint
Requires-Dist: black>=23.0.0; extra == "lint"
Requires-Dist: ruff>=0.1.0; extra == "lint"
Requires-Dist: mypy<1.15,>=1.5.0; extra == "lint"
Requires-Dist: pyright<2,>=1.1.411; extra == "lint"
Dynamic: license-file

# hangulpy

[![PyPI Version](https://img.shields.io/pypi/v/hangulpy.svg)](https://pypi.org/project/hangulpy/)
[![License](https://img.shields.io/github/license/gaon12/hangulpy.svg)](https://github.com/gaon12/hangulpy/blob/main/LICENSE)
[![Python Versions](https://img.shields.io/pypi/pyversions/hangulpy.svg)](https://pypi.org/project/hangulpy/)

`hangulpy`는 [es-hangul](https://github.com/toss/es-hangul)에서 영감을 받아 만든 파이썬 한글 처리 라이브러리입니다. 조사 자동 선택, 초성/부분 음절 검색, 자모 분해/조합, 로마자 표기, 숫자 변환, 한영타 교정까지 한 곳에서 제공합니다.

## 주요 기능

- 조사 자동 선택: `josa`, `josa_pick`, `format_josa`, `has_jongsung`, `has_batchim`
- 초성·구간·퍼지 검색: `hangul_search`, `find_hangul_spans`, `HangulSearcher`, `HangulIndex`, `hangul_similarity`
- 한글·한자 속성 검사: `is_hangul`, `is_complete_hangul`, `get_hangul_components`, `is_hanja`, `split_hanja`
- 자모 분해·조합·편집: `split_syllables`, `join_jamos`, `jamo_len`, `jamo_slice`, `typing_steps`, `map_hangul`
- 변환 기능: `romanize`, `Romanizer`, `standardize_pronunciation`, `number_to_hangul`, `number_to_hangul_mixed`, `hangul_to_number`, `susa`, `days`, `koen`, `enko`, `autofix`

## 설치

```bash
pip install hangulpy
```

업그레이드는 아래처럼 진행할 수 있습니다.

```bash
pip install -U hangulpy
```

## 빠른 예시

```python
from hangulpy import (
    HangulSearcher,
    days,
    get_hangul_components,
    join_jamos,
    josa,
    number_to_hangul_mixed,
    remove_last_character,
    romanize,
    standardize_pronunciation,
)

print(josa("사과", "을/를"))  # 사과를

searcher = HangulSearcher("ㅅㄱ")
print(searcher.search("사과는 맛있다"))  # True

print(get_hangul_components("한"))  # ('ㅎ', 'ㅏ', 'ㄴ')
print(join_jamos(["ㅎ", "ㅏ", "ㄴ", "ㄱ", "ㅡ", "ㄹ"]))  # 한글
print(remove_last_character("전화"))  # 전호
print(number_to_hangul_mixed(123456780))  # 1억2,345만6,780
print(days(29))  # 스무아흐레
print(romanize("광희문", "revised"))  # gwanghuimun
print(standardize_pronunciation("굳이"))  # 구지
print(romanize("오죽헌", "revised", mode="proper", capitalize=True))  # Ojukheon
print(romanize("충청북도", "revised", mode="admin"))  # chungcheongbuk-do
```

## 문서

- [공식 문서](https://hangulpy.uiharu.dev)
- [로마자 표기 문서](https://hangulpy.uiharu.dev/api/conversions/romanize)
- [v1.5 마이그레이션](https://hangulpy.uiharu.dev/migration-v1-5): `chosungIncludes`, `notallowempty`, `allowDoubleConsonant` 제거 예정

## 예제

- 빠른 실행 예제: `examples/quickstart.py`

## 기여

이슈, PR, 문서 개선 모두 환영합니다.
