Collection acronyms for identification - cafi#
library
#
validate
#
validate_catalogue_db(to_eval, acr_db)
#
Validates and creates a catalogue database from input data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
to_eval
|
dict[str, Any]
|
The input dictionary containing raw catalogue data. |
required |
acr_db
|
ACR_DB_T
|
Acronym database used for validation purposes. |
required |
Returns:
Name | Type | Description |
---|---|---|
CCNO_DB_T |
CCNO_DB_T
|
The validated catalogue database. |
Raises:
Type | Description |
---|---|
Exception
|
If the validation process fails, an exception is raised with a message indicating incorrect formatting. |
Source code in src/cafi/library/validate.py
main
#
run()
#
Attempts to load the ACR database or handle version compatibility issues.
This function is intended to be the entry point for running the application.
Currently, it attempts to load the ACR
database using the load_acr_db()
function. If a ValJsonEx
exception occurs,
indicating that the installed cafi
version is incompatible with the latest data, an appropriate error message is printed.
Note
This function currently does not implement any additional functionality beyond the described behavior.
Raises:
Type | Description |
---|---|
ValJsonEx
|
If there is a compatibility issue between the installed cafi version and the latest data. |
Exception
|
Any unhandled exceptions raised by |
Example
run()
This will attempt to load the ACR database or print an error message#
if incompatible versions are detected.#
If an error occurs, it may output something like:#
"installed cafi version is not compatible with the latest data"#
References
load_acr_db()
: Function responsible for loading the ACR database.ValJsonEx
: Exception raised when there's a version compatibility issue.