Library for CJK (chinese, japanese, korean) language data.
Project description
cihai - Python library for CJK (chinese, japanese, korean) data
This project is under active development. Follow our progress and check back for updates!
Usage
Python library only
$ 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": 㑘, 㑤, 㓛, 㘬, 㙉, 㚃, 㚒, 㚥, 㛦, 㜴, 㜺, 㝖, 㤛, 㦝, ...
CLI front-end (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
--------
No library, just data
All datasets that cihai uses have stand-alone tools to export their data. No library required.
unihan-etl - UNIHAN data exports for csv, yaml and json.
Quick links
Python support |
Python 2.7, >= 3.5, pypy |
Source |
|
Docs |
|
Changelog |
|
API |
|
Issues |
|
Travis |
|
Test coverage |
|
pypi |
|
OpenHub |
|
License |
MIT |
git repo |
|
install stable |
|
install dev |
|
tests |
|
Project details
Release history Release notifications | RSS feed
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.9.0a3.tar.gz
(49.5 kB
view details)
File details
Details for the file cihai-0.9.0a3.tar.gz
.
File metadata
- Download URL: cihai-0.9.0a3.tar.gz
- Upload date:
- Size: 49.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f7452b18f4eaa2161df77a1416c61fe09c01cda0b1d2c62466351b4d5c740d4 |
|
MD5 | 3ca88d4b110b3d51989d9f6200dfe1f2 |
|
BLAKE2b-256 | 3587be2b11b8c2d8d235cbc2dd8fa0fbd3224d0494dd1a5b920256b3820ee3f5 |