colrev.record.record.Record¶
- class colrev.record.record.Record(data)[source]¶
Bases:
object
The Record class provides a range of basic Function
Methods
add_field_provenance
Add a field provenance, including source and note (based on a key)
add_field_provenance_note
Add a field provenance note (based on a key)
add_provenance_all
Add a data provenance (source) to all fields
align_provenance
Remove unnecessary provenance information and add missing provenance information
change_entrytype
Change the ENTRYTYPE
complete_provenance
Complete provenance information for indexing
copy_prep_rec
Copy the record object (as a PrepRecord)
defects
Get a list of defects for a field
format_bib_style
Simple formatter for bibliography-style output
get_citation_format
Get the record as a citation
get_colrev_id
Returns the colrev_id of the Record.
get_colrev_pdf_id
Generate the colrev_pdf_id
get_container_title
Get the record's container title (journal name, booktitle, etc.)
get_data
Get the record data
get_diff
Get diff between record objects
get_field_provenance
Get the provenance for a selected field (key)
get_field_provenance_notes
Get field provenance notes based on a key
get_field_provenance_source
Get the provenance source for a selected field (key)
get_record_change_score
Determine how much records changed
get_record_similarity
Determine the similarity between two records (their masterdata)
get_tei_filename
Get the TEI filename associated with the file (PDF)
get_toc_key
Get the record's toc-key
get_value
Get a record value (based on the key parameter)
has_fatal_quality_defects
Check whether a record has fatal quality defects
has_pdf_defects
Check whether the PDF has quality defects
has_quality_defects
Check whether a record (or specific field/key) has quality defects
ignore_defect
Ignore a defect for a field
ignored_defect
Get a list of ignored defects for a record
is_retracted
Check for potential retracts
masterdata_is_curated
Check whether the record masterdata is curated
merge
General-purpose record merging for preparation, curated/non-curated records and records with origins
prescreen_exclude
Prescreen-exclude a record
print_citation_format
Print the record as a citation
remove_field
Remove a field
remove_field_provenance_note
Remove field provenance notes based on a key (also if IGNORE:note)
rename_field
Rename a field
require_prov
Ensure that provenance fields are available
reset_pdf_provenance_notes
Reset the PDF (file) provenance notes
run_pdf_quality_model
Run the PDF quality model
run_quality_model
Update the masterdata provenance
set_masterdata_complete
Set the masterdata to complete
set_masterdata_consistent
Set the masterdata to consistent
set_masterdata_curated
Set record masterdata to curated
set_status
Set the record status
update_by_record
Update all data of a record object based on another record
update_field
Update a record field (including provenance information)
Attributes
pp
data
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