Skip to main content

Korean Hanja utilities: stroke count, five-elements (ohaeng), and personal-name character filter

Project description

hanja-tools

한국 한자(漢字) 관련 기능을 통합한 Python 패키지입니다.
suminb/hanja가 제공하지 않는 획수·오행·인명용 필터·검색 기능을 추가합니다.

설치

pip install hanja-tools

빠른 시작

from hanja_tools import HanjaDB

db = HanjaDB()

db.get_eum('松')        # '송'  — 한글 음 (suminb/hanja 기반)
db.get_stroke('松')     # 8     — 획수 (Unihan kTotalStrokes)
db.get_ohaeng('松')     # '金'  — 오행 (수리오행법: 8획 끝자리 8 → 金)
db.is_inmyong('松')     # True  — 인명용 한자 여부 (대법원 기준)
db.info('松')
# {'char': '松', 'eum': '송', 'stroke': 8, 'ohaeng': '金', 'inmyong': True}

# 검색
db.search_by_eum('송')           # ['松', '誦', '頌', ...]
db.search_by_stroke(8)           # 8획 한자 목록
db.search_by_ohaeng('木')        # 木 오행 한자 목록
db.search(eum='송', inmyong=True) # 복합 조건

오행 분류표 (수리오행법)

획수 끝자리 오행
1, 2
3, 4
5, 6
7, 8
9, 0

데이터 출처

데이터 출처 라이선스
한자→음 suminb/hanja table.yml (27,497자) CC0
획수 Unicode Unihan Database kTotalStrokes Unicode License
인명용 한자 rutopio/Korean-Name-Hanja-Charset data-gov.csv MIT

라이선스

MIT

Project details


Download files

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

Source Distribution

hanja_tools-0.1.0.tar.gz (320.7 kB view details)

Uploaded Source

Built Distribution

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

hanja_tools-0.1.0-py3-none-any.whl (312.0 kB view details)

Uploaded Python 3

File details

Details for the file hanja_tools-0.1.0.tar.gz.

File metadata

  • Download URL: hanja_tools-0.1.0.tar.gz
  • Upload date:
  • Size: 320.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.1

File hashes

Hashes for hanja_tools-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c4ab26a29cec6be3ceb144c79dd0de239babbaec52078e2e76709b9659f4b816
MD5 6fdc4b8d0e2f38757948d0402186cedf
BLAKE2b-256 6996d63c35d103c0413b9552fb5c16354551f49c39ff02b7bce966866bb56bbf

See more details on using hashes here.

File details

Details for the file hanja_tools-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: hanja_tools-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 312.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.1

File hashes

Hashes for hanja_tools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 73757fce212cbec8232c9ad4ca48714c086c0eb2d97068dd124f821f22e18af4
MD5 cb07b947d9b49e9c4325c91a93d44c84
BLAKE2b-256 54af7b272a9bfd9931f8747481b2179a4fac21230039c9b4a25c325069a4a52f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page