cihai 0.7.4
pip install cihai==0.7.4
Newer version available (0.35.0)
Released:
Library for CJK (chinese, japanese, korean) language data.
Navigation
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: MIT License (MIT)
- Author: Tony Narlock
- Tags cihai
Classifiers
- Development Status
- Intended Audience
- License
- Programming Language
- Topic
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
from cihai.bootstrap import bootstrap_unihan
c = Cihai()
if not c.is_bootstrapped: # download and install Unihan to db
bootstrap_unihan(c.metadata)
c.reflect_db() # automap new table created during bootstrap
query = c.lookup_char('好')
glyph = query.first()
print("lookup for 好: %s" % glyph.kDefinition)
# lookup for 好: good, excellent, fine; well
query = c.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-tabular - 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
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: MIT License (MIT)
- Author: Tony Narlock
- Tags cihai
Classifiers
- Development Status
- Intended Audience
- License
- Programming Language
- Topic
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
File details
Details for the file cihai-0.7.4.tar.gz
.
File metadata
- Download URL: cihai-0.7.4.tar.gz
- Upload date:
- Size: 50.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eaada2e1cd0bc34e3d562f87d7792cfeee73b7135977bb29d0a4e11ebae5dbe3 |
|
MD5 | 43114ab5d200cacd257e35a059e1943d |
|
BLAKE2b-256 | 0d4cd4bf195b3d5f95a9f03bbab8056387db9b8a7934b03b61cd87b738097ead |