Internal API#

See also

cihai’s API

Internals#

Warning

These APIs are purely internal not covered by versioning policies, they can and will break between versions. If you need an internal API stabilized please file an issue.

cihai_cli.cli.HUMAN_UNIHAN_FIELDS = ['char', 'ucn', 'kDefinition', 'kCantonese', 'kHangul', 'kJapaneseOn', 'kKorean', 'kMandarin', 'kVietnamese', 'kTang', 'kTotalStrokes']#

fields which are human friendly

cihai_cli.cli.create_parser()[source]#
Return type:

ArgumentParser

class cihai_cli.cli.CLILoadNamespace(**kwargs)[source]#

Bases: Namespace

config_file: Optional[str]#
version: bool#
log_file: Optional[str]#
__annotations__ = {'config_file': typing.Optional[str], 'log_file': typing.Optional[str], 'version': <class 'bool'>}#
__module__ = 'cihai_cli.cli'#
cihai_cli.cli.cli(_args=None)[source]#

Retrieve CJK information via CLI.

For help and example usage, see documentation:

https://cihai-cli.git-pull.com and https://cihai.git-pull.com

Return type:

None

Parameters:

_args (List[str] | None) –

cihai_cli.cli.create_info_subparser(parser)[source]#
Return type:

ArgumentParser

Parameters:

parser (ArgumentParser) –

cihai_cli.cli.command_info(c, char, show_all)[source]#

Look up a definition by term.

Return type:

None

Parameters:
cihai_cli.cli.create_reverse_subparser(parser)[source]#
Return type:

ArgumentParser

Parameters:

parser (ArgumentParser) –

cihai_cli.cli.command_reverse(c, char, show_all)[source]#

Lookup a word or phrase by searching definitions.

Return type:

None

Parameters:
cihai_cli.cli.setup_logger(logger=None, level='INFO')[source]#

Setup logging for CLI use.

Parameters:
  • logger (Logger) – instance of logger

  • level (str) –

Return type:

None