Skip to main content

Library for CJK (chinese, japanese, korean) language data.

Project description

cihai · Python Package License Code Coverage

Python library for CJK (chinese, japanese, korean) data.

This project is under active development. Follow our progress and check back for updates!

Quickstart

API / Library (this repository)

$ pip install --user cihai
from cihai.core import Cihai

c = Cihai()

if not c.unihan.is_bootstrapped:  # download and install Unihan to db
    c.unihan.bootstrap(unihan_options)

query = c.unihan.lookup_char('好')
glyph = query.first()
print("lookup for 好: %s" % glyph.kDefinition)
# lookup for 好: good, excellent, fine; well

query = c.unihan.reverse_char('good')
print('matches for "good": %s ' % ', '.join([glph.char for glph in query]))
# matches for "good": 㑘, 㑤, 㓛, 㘬, 㙉, 㚃, 㚒, 㚥, 㛦, 㜴, 㜺, 㝖, 㤛, 㦝, ...

See API documentation and /examples.

CLI (cihai-cli)

$ pip install --user 'cihai-cli'

Character lookup:

$ cihai info char: 好
kCantonese: hou2 hou3
kDefinition: good, excellent, fine; well
kHangul: 호
kJapaneseOn: KOU
kKorean: HO
kMandarin: hǎo
kTang: '*xɑ̀u *xɑ̌u'
kTotalStrokes: '6'
kVietnamese: háo
ucn: U+597D

Reverse lookup:

$ cihai reverse library
char: 圕
kCangjie: WLGA
kCantonese: syu1
kCihaiT: '308.302'
kDefinition: library
kMandarin: tú
kTotalStrokes: '13'
ucn: U+5715
--------

UNIHAN data

All datasets that cihai uses have stand-alone tools to export their data. No library required.

Developing

$ git clone https://github.com/cihai/cihai.git`
$ cd cihai/

Bootstrap your environment and learn more about contributing. We use the same conventions / tools across all cihai projects: pytest, sphinx, flake8, mypy, black, isort, tmuxp, and file watcher helpers (e.g. entr(1)).

Quick links

Docs Build Status

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

cihai-0.15.0.tar.gz (29.0 kB view details)

Uploaded Source

Built Distribution

cihai-0.15.0-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

Details for the file cihai-0.15.0.tar.gz.

File metadata

  • Download URL: cihai-0.15.0.tar.gz
  • Upload date:
  • Size: 29.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for cihai-0.15.0.tar.gz
Algorithm Hash digest
SHA256 0bfeea96b076311492c230b77743efb866843991ba08f5f25252508dbfbe52e6
MD5 11c90f57db1c209c2cf1bca84323c024
BLAKE2b-256 12a167b3c28c37399d9d9045fced36778ed2fb007f00601a5225f7a5ea27a8a6

See more details on using hashes here.

Provenance

File details

Details for the file cihai-0.15.0-py3-none-any.whl.

File metadata

  • Download URL: cihai-0.15.0-py3-none-any.whl
  • Upload date:
  • Size: 20.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for cihai-0.15.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f6be51287130f9f3aea4091a7944c92cc261504335d2cac998de6e3dbb81424d
MD5 f91ffe2a5cee05a6474997e5432b1201
BLAKE2b-256 db8cd93b80e40d331b148d869143b0eda214c73ceba452df21822e637daf4d10

See more details on using hashes here.

Provenance

Supported by

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