Skip to main content

Command line frontend for the cihai CJK language library

Project description

cihai-cli

Command line interface to the cihai CJK-language library

Python Package Docs Build Status Code Coverage License

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

Installation

$ pip install --user cihai[cli]

Developmental releases

You can test the unpublished version of cihai-cli before its released.

  • pip:

    $ pip install --user --upgrade --pre cihai[cli]
    
  • pipx:

    $ pipx install --suffix=@next 'cihai[cli]' --pip-args '\--pre' --include-deps --force
    

    Then use cihai@next info 好.

For more information see developmental releases

Character lookup

See CLI in the documentation for full usage information.

$ 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'
ucn: U+597D

# retrieve all character information (including book indices)
$ cihai info  -a
char: 好
kCangjie: VND
kCantonese: hou2 hou3
kCihaiT: '378.103'
kDefinition: good, excellent, fine; well
kFenn: 552A
kFourCornerCode: '4744.7'
kFrequency: '1'
kGradeLevel: '1'
kHKGlyph: 0871
kHangul: 호
kHanyuPinlu: hǎo(6060) hāo(142) hào(115)
kHanyuPinyin: 21028.010:hǎo,hào
kJapaneseKun: KONOMU SUKU YOI
kJapaneseOn: KOU
kKorean: HO
kMandarin: hǎo
kPhonetic: '481'
kRSAdobe_Japan1_6: C+1975+38.3.3 C+1975+39.3.3
kRSKangXi: '38.3'
kTang: '*xɑ̀u *xɑ̌u'
kTotalStrokes: '6'
kVietnamese: háo
kXHC1983: 0445.030:hǎo 0448.030:hào
ucn: U+597D

Reverse lookup

$ cihai reverse library
char: 圕
kCantonese: syu1
kDefinition: library
kJapaneseOn: TOSHOKAN SHO
kMandarin: tú
kTotalStrokes: '13'
ucn: U+5715
--------
char: 嫏
kCantonese: long4
kDefinition: the place where the supreme stores his books; library
kJapaneseOn: ROU
kMandarin: láng
kTotalStrokes: '11'
ucn: U+5ACF
--------

Developing

poetry is a required package to develop.

git clone https://github.com/cihai/cihai-cli.git

cd cihai-cli

poetry install -E "docs test coverage lint format"

Makefile commands prefixed with watch_ will watch files and rerun.

Tests

poetry run py.test

Helpers: make test Rerun tests on file change: make watch_test (requires entr(1))

Documentation

Default preview server: http://localhost:8037

cd docs/ and make html to build. make serve to start http server.

Helpers: make build_docs, make serve_docs

Rebuild docs on file change: make watch_docs (requires entr(1))

Rebuild docs and run server via one terminal: make dev_docs (requires above, and a make(1) with -J support, e.g. GNU Make)

Formatting / Linting

The project uses black and isort (one after the other) and runs flake8 via CI. See the configuration in pyproject.toml and `setup.cfg`:

make black isort: Run black first, then isort to handle import nuances make flake8, to watch (requires entr(1)): make watch_flake8

Releasing

As of 0.6, poetry handles virtualenv creation, package requirements, versioning, building, and publishing. Therefore there is no setup.py or requirements files.

Update __version__ in __about__.py and `pyproject.toml`:

git commit -m 'build(cihai-cli): Tag v0.1.1'
git tag v0.1.1
git push
git push --tags
poetry build
poetry deploy

Quick links

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-cli-0.9.0a1.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

cihai_cli-0.9.0a1-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file cihai-cli-0.9.0a1.tar.gz.

File metadata

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

File hashes

Hashes for cihai-cli-0.9.0a1.tar.gz
Algorithm Hash digest
SHA256 0d59b4c07ce6e6b79e04198caaf09cd636c564fd37aed0773de950c6a6459efd
MD5 73abf3276fec0d6b4e5677e1fbcfd6b4
BLAKE2b-256 0bb5e89b0b6924ecd0d5a3cb77abed8ec4b18fefbae25d67658b915c13d1bf35

See more details on using hashes here.

File details

Details for the file cihai_cli-0.9.0a1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for cihai_cli-0.9.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 30345cf1c10b89ff46fae92294fd6fc24c265d151fcfcc0faee12b29ccdc825e
MD5 51c6a1de3f68f17e182f8d91bfb23823
BLAKE2b-256 bf8cd07fbab982ac2c37fcd407faa86d03426dce28858e340863432f91513078

See more details on using hashes here.

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