Core - cihai.core¶
Cihai core functionality.
-
exception cihai.core.CihaiConfigError¶
Bases:
CihaiExceptionCihai Configuration error.
-
cihai.core.is_valid_config(config)¶
Upcast cihai configuration.
NOTE: This does not validate configuration yet!
- Parameters:
config (UntypedDict)
- Return type:
-
class cihai.core.Cihai¶
Bases:
objectCentral application object.
By default, this automatically adds the UNIHAN dataset.
Notes
Inspired by the early pypa/warehouse application object.
Configuration templates
The
configdictparameter supports a basic template system for replacing XDG Base Directory directory variables, tildes and environmentas variables. This is done by passing the option dict throughcihai.config.expand_config()during initialization.Examples
To use cihai programmatically, invoke and install the UNIHAN dataset — see Examples for a runnable walkthrough based on
examples/basic_usage.py.is_bootstrappedcan check if the system has the database installed.