ocrd_network.utils module

ocrd_network.utils.call_sync(func)[source]
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.generate_created_time() int[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

ocrd_network.utils.validate_and_load_config(config_path: str) Dict[source]
ocrd_network.utils.verify_database_uri(mongodb_address: str) str[source]
ocrd_network.utils.verify_and_parse_mq_uri(rabbitmq_address: str)[source]

Check the full list of available parameters in the docs here: https://pika.readthedocs.io/en/stable/_modules/pika/connection.html#URLParameters

ocrd_network.utils.download_ocrd_all_tool_json(ocrd_all_url: str)[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) bool[source]
ocrd_network.utils.stop_mets_server(mets_server_url: str) bool[source]