colrev.record.record.Record¶
- class Record(data)[source]¶
Bases:
object
The Record class provides a range of basic convenience functions
Methods
Add a field provenance, including source and note (based on a key)
Add a field provenance note (based on a key)
Add a data provenance (source) to all fields
Remove unnecessary provenance information and add missing provenance information
Change the ENTRYTYPE
Complete provenance information for indexing
Copy the record object (as a PrepRecord)
Get a list of defects for a field
Simple formatter for bibliography-style output
Get the record as a citation
Returns the colrev_id of the Record.
Generate the colrev_pdf_id
Get the record's container title (journal name, booktitle, etc.)
Get the record data
Get diff between record objects
Get the provenance for a selected field (key)
Get field provenance notes based on a key
Get the provenance source for a selected field (key)
Determine how much records changed
Determine the similarity between two records (their masterdata)
Get the TEI filename associated with the file (PDF)
Get the record's toc-key
Get a record value (based on the key parameter)
Check whether a record has fatal quality defects
Check whether the PDF has quality defects
Check whether a record (or specific field/key) has quality defects
Ignore a defect for a field
Get a list of ignored defects for a record
Check for potential retracts
Check whether the record masterdata is curated
General-purpose record merging for preparation, curated/non-curated records and records with origins
Prescreen-exclude a record
Print the record as a citation
Remove a field
Remove field provenance notes based on a key (also if IGNORE:note)
Rename a field
Ensure that provenance fields are available
Reset the PDF (file) provenance notes
Run the PDF quality model
Update the masterdata provenance
Set the masterdata to complete
Set the masterdata to consistent
Set record masterdata to curated
Set the record status
Update all data of a record object based on another record
Update a record field (including provenance information)
Attributes
pp
Dictionary containing the record data
- add_field_provenance(*, key, source, note='')[source]¶
Add a field provenance, including source and note (based on a key)
- Return type:
None
- add_field_provenance_note(*, key, note)[source]¶
Add a field provenance note (based on a key)
- Return type:
None
- add_provenance_all(*, source)[source]¶
Add a data provenance (source) to all fields
- Return type:
None
- align_provenance()[source]¶
Remove unnecessary provenance information and add missing provenance information
- Return type:
None
- complete_provenance(*, source_info)[source]¶
Complete provenance information for indexing
- Return type:
bool
- data¶
Dictionary containing the record data
- get_colrev_id(*, assume_complete=False)[source]¶
Returns the colrev_id of the Record.
- Return type:
str
- get_container_title(*, na_string='NA')[source]¶
Get the record’s container title (journal name, booktitle, etc.)
- Return type:
str
- get_diff(other_record, *, identifying_fields_only=True)[source]¶
Get diff between record objects
- Return type:
list
- get_field_provenance(*, key, default_source='ORIGINAL')[source]¶
Get the provenance for a selected field (key)
- Return type:
dict
- get_field_provenance_notes(key)[source]¶
Get field provenance notes based on a key
- Return type:
list
- get_field_provenance_source(key)[source]¶
Get the provenance source for a selected field (key)
- Return type:
str
- classmethod get_record_change_score(record_a, record_b)[source]¶
Determine how much records changed
This method is less sensitive than get_record_similarity, especially when fields are missing. For example, if the journal field is missing in both records, get_similarity will return a value > 1.0. The get_record_changes will return 0.0 (if all other fields are equal).
- Return type:
float
- classmethod get_record_similarity(record_a, record_b)[source]¶
Determine the similarity between two records (their masterdata)
- Return type:
float
- get_value(key, *, default=None)[source]¶
Get a record value (based on the key parameter)
- Return type:
str
- has_fatal_quality_defects()[source]¶
Check whether a record has fatal quality defects
- Return type:
bool
- has_quality_defects(*, key='')[source]¶
Check whether a record (or specific field/key) has quality defects
- Return type:
bool
- ignored_defect(*, key, defect)[source]¶
Get a list of ignored defects for a record
- Return type:
bool
- merge(merging_record, *, default_source, preferred_masterdata_source_prefixes=None)[source]¶
General-purpose record merging for preparation, curated/non-curated records and records with origins
Apply heuristics to create a fusion of the best fields based on quality heuristics
- Return type:
None
- prescreen_exclude(*, reason, print_warning=False)[source]¶
Prescreen-exclude a record
- Return type:
None
- remove_field_provenance_note(*, key, note)[source]¶
Remove field provenance notes based on a key (also if IGNORE:note)
- Return type:
None
- run_pdf_quality_model(pdf_qm, *, set_prepared=False)[source]¶
Run the PDF quality model
- Return type:
None
- run_quality_model(quality_model, *, set_prepared=False)[source]¶
Update the masterdata provenance
- Return type:
None
- set_masterdata_complete(*, source, masterdata_repository, replace_source=True)[source]¶
Set the masterdata to complete
- Return type:
None