Package base classes

class ReviewTypePackageBaseClass(*, operation, settings)[source]

Bases: ABC

The base class for ReviewType packages

The following cli command calls the initialize method of a ReviewType package:

colrev init --type package_name -> calls package.initialize()

abstract initialize(settings)[source]

Initialize the review type

Return type:

dict

class SearchSourcePackageBaseClass(*, source_operation, settings=None)[source]

Bases: ABC

The base class for SearchSource packages

The following cli commands call specific methods of a SearchSource package:

colrev search --add package_name -> calls package.add_endpoint()

colrev search -> calls search operation -> calls package.search()

colrev load -> calls load operation -> calls package.load()

colrev prep -> calls prep operation -> calls package.prep()

abstract classmethod add_endpoint(operation, params)[source]

Add the SearchSource as an endpoint.

Return type:

SearchSource

classmethod ensure_append_only(filename)[source]

Ensure that the SearchSource is append-only.

Return type:

bool

abstract classmethod heuristic(filename, data)[source]

Heuristic to identify which SearchSource a search file belongs to.

Return type:

dict

abstract classmethod load(*, filename, logger)[source]

Load records from the SearchSource.

Return type:

dict

Retrieve masterdata from the SearchSource.

Return type:

Record

abstract prepare(record, source)[source]

Run the custom source-prep operation.

Return type:

Record

abstract search(rerun)[source]

Run a search of the SearchSource.

Return type:

None

class PrepPackageBaseClass(*, prep_operation, settings)[source]

Bases: ABC

The base class for Prep packages.

The following cli command calls the prepare method of a Prep package:

colrev prep -> calls package.prepare()

abstract prepare(record)[source]

Run the prep operation.

Return type:

Record

class PrepManPackageBaseClass(*, prep_man_operation, settings)[source]

Bases: ABC

The base class for PrepMan packages.

The following cli command calls the prepare_manual method of a PrepMan package:

colrev prep-man -> calls package.prepare_manual()

abstract prepare_manual(records)[source]

Run the prep-man operation.

Return type:

dict

class DedupePackageBaseClass(*, dedupe_operation, settings)[source]

Bases: ABC

The base class for Dedupe packages.

The following cli command calls the dedupe method of a Dedupe package:

colrev dedupe -> calls package.run_dedupe()

abstract run_dedupe()[source]

Run the dedupe operation.

Return type:

None

class PrescreenPackageBaseClass(*, prescreen_operation, settings)[source]

Bases: ABC

The base class for Prescreen packages.

The following cli command calls the run_prescreen method of a Prescreen package:

colrev prescreen -> calls package.run_prescreen()

abstract run_prescreen(records, split)[source]

Run the prescreen operation.

Return type:

dict

class PDFGetPackageBaseClass(*, pdf_get_operation, settings)[source]

Bases: ABC

The base class for PDFGet packages.

The following cli command calls the pdf_get method of a PDFGet package:

colrev pdf-get -> calls package.get_pdf()

abstract get_pdf(record)[source]

Run the pdf-get operation.

Return type:

Record

class PDFGetManPackageBaseClass(*, pdf_get_man_operation, settings)[source]

Bases: ABC

The base class for PDFGetMan packages.

The following cli command calls the pdf_get_man method of a PDFGetMan package:

colrev pdf-get-man -> calls package.pdf_get_man()

abstract pdf_get_man(records)[source]

Run the pdf-get-man operation.

Return type:

dict

class PDFPrepPackageBaseClass(*, pdf_prep_operation, settings)[source]

Bases: ABC

The base class for PDFPrep packages.

The following cli command calls the prep_pdf method of a PDFPrep package:

colrev pdf-prep -> calls package.prep_pdf()

abstract prep_pdf(record, pad)[source]

Run the prep-pdf operation.

Return type:

Record

class PDFPrepManPackageBaseClass(*, pdf_prep_man_operation, settings)[source]

Bases: ABC

The base class for PDFPrepMan packages.

The following cli command calls the pdf_prep_man method of a PDFPrepMan package:

colrev pdf-prep-man -> calls package.pdf_prep_man()

abstract pdf_prep_man(records)[source]

Run the pdf-prep-man operation.

Return type:

dict

class ScreenPackageBaseClass(*, screen_operation, settings)[source]

Bases: ABC

The base class for Screen packages.

The following cli command calls the run_screen method of a Screen package:

colrev screen -> calls package.run_screen()

abstract run_screen(records, split)[source]

Run the screen operation.

Return type:

dict

class DataPackageBaseClass(*, data_operation, settings)[source]

The base class for Data packages.

The following cli command calls the update_data method of a Data package:

colrev data -> calls package.update_data()

abstract get_advice()[source]

Get advice on how to operate the data package endpoint.

Return type:

dict

abstract update_data(records, synthesized_record_status_matrix, silent_mode)[source]

Update the data by running the data operation.

Return type:

None

abstract update_record_status_matrix(synthesized_record_status_matrix, endpoint_identifier)[source]

Update the record status matrix.

Return type:

None