Programmatic PythonΒΆ

Programmatic use of CoLRev in other Python applications is supported. The following code block illustrates the required steps.

import colrev.review_manager

# Initialize the ReviewManager
review_manager = colrev.review_manager.ReviewManager()

# Get an operation and notify the ReviewManager
prep_operation = review_manager.get_prep_operation()

# Load the records and apply changes
records = review_manager.dataset.load_records_dict()
for record in records.values():
    ...

# Save the changes, add them to git, and create commit
review_manager.dataset.save_records_dict(records)
review_manager.dataset.create_commit(msg="Pre-screening (package/script X")