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.

CLI functionality for cihai-cli.

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]#

Create argparse for cihai-cli.

Return type:

ArgumentParser

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

Bases: Namespace

Typing for CLI 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]#

Create cihai info subparser.

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]#

Create cihai reverse subparser.

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]#

Configure logging for CLI use.

Return type:

None

Parameters:
  • logger (Logger) – Instance of logger, if one set up.

  • level (str) –