ocrd_network.utils module¶
- ocrd_network.utils.calculate_execution_time(start: datetime, end: datetime) int [source]¶
Calculates the difference between ‘start’ and ‘end’ datetime. Returns the result in milliseconds
- ocrd_network.utils.calculate_processing_request_timeout(amount_pages: int, timeout_per_page: float = 20.0) float [source]¶
- ocrd_network.utils.generate_id() str [source]¶
Generate the id to be used for processing job ids. Note, workspace_id and workflow_id in the reference WebAPI implementation are produced in the same manner
- async ocrd_network.utils.generate_workflow_content(workflow: UploadFile, encoding: str = 'utf-8')[source]¶
- ocrd_network.utils.generate_workflow_content_hash(workflow_content: str, encoding: str = 'utf-8')[source]¶
- ocrd_network.utils.post_to_callback_url(logger, callback_url: str, result_message: OcrdResultMessage)[source]¶
- ocrd_network.utils.get_ocrd_workspace_instance(mets_path: str, mets_server_url: str | None = None) Workspace [source]¶
- ocrd_network.utils.get_ocrd_workspace_physical_pages(mets_path: str, mets_server_url: str | None = None) List[str] [source]¶
- ocrd_network.utils.is_mets_server_running(mets_server_url: str, ws_dir_path: str | None = None) bool [source]¶