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
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": 㑘, 㑤, 㓛, 㘬, 㙉, 㚃, 㚒, 㚥, 㛦, 㜴, 㜺, 㝖, 㤛, 㦝, ...
CLI (cihai-cli)
# stable
$ pip install --user cihai-cli
# pre-release
$ pip install --user --pre 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.
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.0a4.tar.gz
(54.9 kB
view details)
File details
Details for the file cihai-0.9.0a4.tar.gz
.
File metadata
- Download URL: cihai-0.9.0a4.tar.gz
- Upload date:
- Size: 54.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fead42bdbc86c48ce49bbc578cbb4314710e4efd8b3035abddc1420679e6e62e |
|
MD5 | bd1b5d5622ddc69a3dce1635506b6ee9 |
|
BLAKE2b-256 | 8e80ab5ca1dbe6b53fdb51c67204d2c64db811c4999e09e2f92cd43c28c1d2b9 |