ocrd.processor.base module

class ocrd.processor.base.Processor(workspace, ocrd_tool=None, parameter=None, input_file_grp='INPUT', output_file_grp='OUTPUT', page_id=None, dump_json=False, version=None)[source]

Bases: object

A processor runs an algorithm based on the workspace, the mets.xml in the workspace (and the input files defined therein) as well as optional parameter.

input_files

List the input files

process()[source]

Process the workspace

verify()[source]

Verify that the input is fulfills the processor’s requirements.

ocrd.processor.base.run_cli(executable, mets_url=None, resolver=None, workspace=None, page_id=None, log_level=None, input_file_grp=None, output_file_grp=None, parameter=None, working_dir=None)[source]

Create a workspace for mets_url and run MP CLI through it

ocrd.processor.base.run_processor(processorClass, ocrd_tool=None, mets_url=None, resolver=None, workspace=None, page_id=None, log_level=None, input_file_grp=None, output_file_grp=None, parameter=None, working_dir=None)[source]

Create a workspace for mets_url and run processor through it

Parameters:parameter (string) – URL to the parameter