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!
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.
- unihan-etl - UNIHAN data exports for csv, yaml and json.
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
- Quickstart
- Datasets a full list of current and future data sets
- Python API
- Roadmap
- Python support: >= 3.7, pypy
- Source: https://github.com/cihai/cihai
- Docs: https://cihai.git-pull.com
- Changelog: https://cihai.git-pull.com/history.html
- API: https://cihai.git-pull.com/api.html
- Issues: https://github.com/cihai/cihai/issues
- Test coverage: https://codecov.io/gh/cihai/cihai
- pypi: https://pypi-hypernode.com/pypi/cihai
- OpenHub: https://www.openhub.net/p/cihai
- License: MIT
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
Built Distribution
File details
Details for the file cihai-0.14.1.tar.gz
.
File metadata
- Download URL: cihai-0.14.1.tar.gz
- Upload date:
- Size: 29.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2981f1796649948e120436eb27cfa3e97b872769d6d0a3c0a145638d6d7038a3 |
|
MD5 | b2541c7d13d5c45595f637dca4af3fac |
|
BLAKE2b-256 | ce5c6fe931ddcf2c86f1dc6faed318a6026012ccd1110e9f849ea30120a2bff1 |
Provenance
File details
Details for the file cihai-0.14.1-py3-none-any.whl
.
File metadata
- Download URL: cihai-0.14.1-py3-none-any.whl
- Upload date:
- Size: 20.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c648078e1b6afaf70ff131c560fba6ad88e5db5b6c9c74974e780d2c852c078e |
|
MD5 | 699b726c657fbb8ef1a3dcf415ec11b7 |
|
BLAKE2b-256 | 1e69636dc6a2facffac4244f2d7d3f2bde08d3659ff6f18646ac23e3a333488b |