Using cove as a library (cove.lib)

Currently the main user of cove.lib is cove.views which is responsible for rendering the Cove web application.

common

class cove.lib.common.CustomJsonrefLoader(**kwargs)[source]
get_remote_json(uri, **kwargs)[source]
class cove.lib.common.CustomRefResolver(*args, **kw)[source]
resolve_remote(uri)[source]
class cove.lib.common.SchemaJsonMixin[source]
deref_schema(schema_str)[source]
get_release_pkg_schema_fields()[source]
get_release_pkg_schema_obj(deref=False)[source]
get_release_schema_obj(deref=False)[source]
release_pkg_schema_str
release_schema_str
cove.lib.common.add_is_codelist(obj)[source]

This is needed so that we can detect enums that are arrays as the jsonschema library does not give you any parent information and the codelist property is on the parent in this case. Only applies to release.tag in core schema at the moment.

cove.lib.common.fields_present_generator(json_data, prefix=”)[source]
cove.lib.common.get_additional_codelist_values(schema_obj, codelist_url, json_data)[source]
cove.lib.common.get_counts_additional_fields(json_data, schema_obj, schema_name, context, fields_regex=False)[source]
cove.lib.common.get_fields_present(*args, **kwargs)[source]
cove.lib.common.get_json_data_deprecated_fields(json_data, schema_obj)[source]
cove.lib.common.get_schema_validation_errors(json_data, schema_obj, schema_name, cell_src_map, heading_src_map, extra_checkers=None)[source]
cove.lib.common.get_spreadsheet_meta_data(request, data_object, schema, file_type=’xlsx’, name=’Meta’)[source]
cove.lib.common.required_draft4(validator, required, instance, schema)[source]
cove.lib.common.schema_dict_fields_generator(schema_dict)[source]
cove.lib.common.unique_ids(validator, ui, instance, schema)[source]

converters

exceptions

exception cove.lib.exceptions.CoveInputDataError(context=None)[source]

An error that we think is due to the data input by the user, rather than a bug in the application.

exception cove.lib.exceptions.UnrecognisedFileType(context=None)[source]
context = {‘sub_title’: <django.utils.functional.lazy.<locals>.__proxy__ object>, ‘msg’: <django.utils.functional.lazy.<locals>.__proxy__ object>, ‘link’: ‘index’, ‘link_text’: <django.utils.functional.lazy.<locals>.__proxy__ object>}
cove.lib.exceptions.cove_spreadsheet_conversion_error(func)[source]
cove.lib.exceptions.cove_web_input_error(func)[source]

ocds

threesixtygiving

tools

cove.lib.tools.datetime_or_date(instance)[source]
cove.lib.tools.get_file_type(file)[source]
cove.lib.tools.get_no_exception(item, key, fallback)[source]
cove.lib.tools.ignore_errors(f)[source]
cove.lib.tools.to_list(item)[source]
cove.lib.tools.update_docs(document_parent, counter)[source]