OpenDataServices / lib-cove-2

https://libcove2.readthedocs.io/en/latest/
Other
0 stars 0 forks source link

libcove to libcove2 migration #3

Open jpmckinney opened 2 weeks ago

jpmckinney commented 2 weeks ago

Starting to document the migration path to identify anything missing.

Since a lot is missing, maybe we can start by establishing what is NOT planned for libcove2 and should instead be the responsibility of individual CoVEs.

Usage notes are from OCDS and OC4IDS perspective.

Validation

libcove.lib.common Question / Solution
common_checks_context High priority: This is the most common API call
get_additional_codelist_values Do any standards other than OCDS use codelists?
get_field_coverage
get_json_data_deprecated_fields Do any standards other than OCDS use deprecated fields? (Called by common_checks_context, but OCDS only directly calls it in tests)
get_json_data_generic_paths (Called by common_checks_context, but OCDS only directly calls it in tests)
get_json_data_missing_ids Do any standards other than OCDS use id in objects? (Called by common_checks_context, but OCDS only directly calls it in tests)
get_schema_codelist_paths Do any standards other than OCDS use codelists?
get_schema_validation_errors
get_spreadsheet_meta_data Do any standards other than OCDS have spreadsheet metadata?
load_core_codelists Do any standards other than OCDS use codelists?
schema_dict_fields_generator Change to libcove2.common
SchemaJsonMixin
unique_ids Do any standards other than OCDS use id in objects?
validator

Conversion

libcove.lib.converters Question / Solution
convert_json
convert_spreadsheet

Utilities

libcove.lib Solution
exceptions.CoveInputDataError In principle, not needed as not raised by libcove2
tools.decimal_default Check if actually needed in specific CoVE
tools.get_file_type Check if actually needed in specific CoVE
tools.get_no_exception Use item.get(key, fallback)
tools.ignore_errors Write code correctly to avoid key errors, etc.
tools.to_list Use x if isinstance(x, list) else [x]
tools.update_docs OCDS specific
odscjames commented 5 days ago

Thanks for this. (And similar issue in lib-cove-web-2)

I've started writing up pages on migration in both repo's docs, eg: https://libcove2.readthedocs.io/en/latest/migration-from-lib-cove.html I will refer to this list and both flesh out the docs and add specific issues for more work over time.