ocrd 3.5.1__py3-none-any.whl → 3.6.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ocrd/cli/__init__.py +6 -2
- ocrd/cli/bashlib.py +7 -2
- ocrd/cli/log.py +7 -2
- ocrd/cli/network.py +0 -2
- ocrd/cli/ocrd_tool.py +26 -4
- ocrd/cli/process.py +1 -0
- ocrd/cli/resmgr.py +0 -1
- ocrd/cli/validate.py +32 -13
- ocrd/cli/workspace.py +125 -52
- ocrd/cli/zip.py +13 -4
- ocrd/decorators/__init__.py +28 -52
- ocrd/decorators/loglevel_option.py +4 -0
- ocrd/decorators/mets_find_options.py +2 -1
- ocrd/decorators/ocrd_cli_options.py +3 -7
- ocrd/decorators/parameter_option.py +12 -11
- ocrd/lib.bash +6 -13
- ocrd/mets_server.py +6 -10
- ocrd/processor/base.py +88 -71
- ocrd/processor/builtin/dummy_processor.py +7 -4
- ocrd/processor/builtin/filter_processor.py +3 -2
- ocrd/processor/helpers.py +5 -6
- ocrd/processor/ocrd_page_result.py +7 -5
- ocrd/resolver.py +42 -32
- ocrd/task_sequence.py +11 -4
- ocrd/workspace.py +64 -54
- ocrd/workspace_backup.py +3 -0
- ocrd/workspace_bagger.py +15 -8
- {ocrd-3.5.1.dist-info → ocrd-3.6.0.dist-info}/METADATA +1 -1
- ocrd-3.6.0.dist-info/RECORD +125 -0
- ocrd_modelfactory/__init__.py +4 -2
- ocrd_models/constants.py +18 -1
- ocrd_models/ocrd_agent.py +1 -1
- ocrd_models/ocrd_exif.py +7 -3
- ocrd_models/ocrd_file.py +24 -19
- ocrd_models/ocrd_mets.py +90 -67
- ocrd_models/ocrd_page.py +17 -13
- ocrd_models/ocrd_xml_base.py +1 -0
- ocrd_models/report.py +2 -1
- ocrd_models/utils.py +4 -3
- ocrd_models/xpath_functions.py +3 -1
- ocrd_network/__init__.py +1 -2
- ocrd_network/cli/__init__.py +0 -2
- ocrd_network/cli/client.py +122 -50
- ocrd_network/cli/processing_server.py +1 -2
- ocrd_network/client.py +2 -2
- ocrd_network/client_utils.py +30 -13
- ocrd_network/constants.py +1 -6
- ocrd_network/database.py +3 -3
- ocrd_network/logging_utils.py +2 -7
- ocrd_network/models/__init__.py +0 -2
- ocrd_network/models/job.py +2 -5
- ocrd_network/models/workspace.py +1 -1
- ocrd_network/process_helpers.py +54 -17
- ocrd_network/processing_server.py +63 -114
- ocrd_network/processing_worker.py +6 -5
- ocrd_network/rabbitmq_utils/__init__.py +2 -0
- ocrd_network/rabbitmq_utils/helpers.py +24 -7
- ocrd_network/runtime_data/__init__.py +1 -2
- ocrd_network/runtime_data/deployer.py +12 -85
- ocrd_network/runtime_data/hosts.py +61 -130
- ocrd_network/runtime_data/network_agents.py +7 -31
- ocrd_network/runtime_data/network_services.py +1 -1
- ocrd_network/server_cache.py +1 -1
- ocrd_network/server_utils.py +13 -52
- ocrd_network/utils.py +1 -0
- ocrd_utils/__init__.py +4 -4
- ocrd_utils/config.py +86 -76
- ocrd_utils/deprecate.py +3 -0
- ocrd_utils/image.py +51 -23
- ocrd_utils/introspect.py +8 -3
- ocrd_utils/logging.py +12 -7
- ocrd_utils/os.py +16 -3
- ocrd_utils/str.py +32 -16
- ocrd_validators/json_validator.py +4 -1
- ocrd_validators/ocrd_tool_validator.py +2 -1
- ocrd_validators/ocrd_zip_validator.py +5 -4
- ocrd_validators/page_validator.py +21 -9
- ocrd_validators/parameter_validator.py +3 -2
- ocrd_validators/processing_server_config.schema.yml +1 -33
- ocrd_validators/resource_list_validator.py +3 -1
- ocrd_validators/workspace_validator.py +30 -20
- ocrd_validators/xsd_mets_validator.py +2 -1
- ocrd_validators/xsd_page_validator.py +2 -1
- ocrd_validators/xsd_validator.py +4 -2
- ocrd-3.5.1.dist-info/RECORD +0 -128
- ocrd_network/cli/processor_server.py +0 -31
- ocrd_network/models/ocrd_tool.py +0 -12
- ocrd_network/processor_server.py +0 -255
- {ocrd-3.5.1.dist-info → ocrd-3.6.0.dist-info}/LICENSE +0 -0
- {ocrd-3.5.1.dist-info → ocrd-3.6.0.dist-info}/WHEEL +0 -0
- {ocrd-3.5.1.dist-info → ocrd-3.6.0.dist-info}/entry_points.txt +0 -0
- {ocrd-3.5.1.dist-info → ocrd-3.6.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
ocrd/__init__.py,sha256=ZswMVmlqFhAEIzMR3my6IKPq9XLH21aDPC_m_8Jh4dA,1076
|
|
2
|
+
ocrd/constants.py,sha256=6dn3mG54WqHsKInmLZp4kJjNqqPtBoFoSuLUuRbOps0,740
|
|
3
|
+
ocrd/lib.bash,sha256=Eu-_Eb3uUNEoa3GmSDyUm_4FmmSJctglPOWz8EcBJ2c,10395
|
|
4
|
+
ocrd/mets_server.py,sha256=eXIbSip6gYi5RyJZlriIrR9lUGpJjL0kXq3UDZPeqVs,22274
|
|
5
|
+
ocrd/ocrd-all-tool.json,sha256=EYXmMzP68p3KzL8nUZ16TCX2chQzKkAeISvuXqI_yIw,2094
|
|
6
|
+
ocrd/resolver.py,sha256=7uwHRxaK8YMdKHe_a2dfrcNwL6UhQRJRVBrIX7GST7Q,15443
|
|
7
|
+
ocrd/resource_list.yml,sha256=82-PiqkZnka1kTj3MQqNn4wXWKHHtoFchsQuetWuqFs,2633
|
|
8
|
+
ocrd/resource_manager.py,sha256=kIWDoKxWH4IJE1gcoTcCRQjYjieCqiQclyuyF6Y9b8A,16813
|
|
9
|
+
ocrd/task_sequence.py,sha256=r4e4iaP9AXzTL2xQZpfYnHuFXty5pE-ym3gIyUz1aJc,7180
|
|
10
|
+
ocrd/workspace.py,sha256=UL_gX0KA-MmpayBl9KGYTfcl-1Canj8S991G9RHhu70,65216
|
|
11
|
+
ocrd/workspace_backup.py,sha256=aUOnYeJ-nWu-Zve27B0cYd9ZtBkmQX4F4Wim2UcrR5I,3624
|
|
12
|
+
ocrd/workspace_bagger.py,sha256=4viSQoWteW0V4B_blB6asJXd4-qniGGJyCPfKnrsyrY,12054
|
|
13
|
+
ocrd/cli/__init__.py,sha256=klgd85WNdLzqivbkEbt5cMOFvEoMoEE2KnT_oKAwTBs,2888
|
|
14
|
+
ocrd/cli/bashlib.py,sha256=RLp6ejgbxLjGfNmeniVTuzLtrGeJrGJAZYc9JPT7U68,5998
|
|
15
|
+
ocrd/cli/log.py,sha256=jRgxdoJS14OPXI9LpovPqB3JcxlcGZH7QOde6-TmykQ,1566
|
|
16
|
+
ocrd/cli/network.py,sha256=iQ0AhQRGvIFyJY9RBArUiA_wuz7IfNKvU4L8KpVggnY,530
|
|
17
|
+
ocrd/cli/ocrd_tool.py,sha256=kB3Y3tj7Fpz6Ts4KgVlznhXpAx8gCDvJTnO39j8SGL4,7679
|
|
18
|
+
ocrd/cli/process.py,sha256=yfhBSYmuY5k2AccKwiNvG9hCDx1coYyWjq9BBwYaL3Y,1234
|
|
19
|
+
ocrd/cli/resmgr.py,sha256=b1TMZ3D0d50RR9XjQdPil3sfaoTVAso8LjHXZ9P7WfI,10109
|
|
20
|
+
ocrd/cli/validate.py,sha256=P8jrzAnoU-5TUjLNA7s_ZMY2Krw5Y-SVIZPhdOk25cw,5931
|
|
21
|
+
ocrd/cli/workspace.py,sha256=0UzKN7vvD0n5wwxldzLHOlikDDIyiBiV1PuTOKCnnnE,41279
|
|
22
|
+
ocrd/cli/zip.py,sha256=3HMUbVsPTK3SRuF5oZnCZLjoqXJK-AYpA-rMqenY858,5965
|
|
23
|
+
ocrd/decorators/__init__.py,sha256=gU7WDp2re8BF8DU4PVRRqgQpp7TR5wMOnoafcbMAjws,6324
|
|
24
|
+
ocrd/decorators/loglevel_option.py,sha256=QHVZ_72rkt2hqGSP9vuIXUYo5YhBxLsldUsaVVpb_YY,802
|
|
25
|
+
ocrd/decorators/mets_find_options.py,sha256=8fiSdk-415o6-iBPB2T9He_v52qE8cTj3cCnH4y08Ag,635
|
|
26
|
+
ocrd/decorators/ocrd_cli_options.py,sha256=Bemkq3V3QkOI3nNqGzphaNW7gjU9vNN-M5F2DvxvioM,2479
|
|
27
|
+
ocrd/decorators/parameter_option.py,sha256=TnCIcV9L5oAnI1Ew2TyFzo5FAwiIzWl2pn8oaD9jfEU,1056
|
|
28
|
+
ocrd/processor/__init__.py,sha256=39ymNwYRdc-b_OJzzKmWCvo2ga3KdsGSYDHE1Hzkn_w,274
|
|
29
|
+
ocrd/processor/base.py,sha256=TOUy_s14aM-09HSSzihgCeTOSHRpTO4U4bze7QUSDwg,60382
|
|
30
|
+
ocrd/processor/helpers.py,sha256=4lR_QvZsxvh7f8_uK9YzdHP5-hvFU4qqYM_Cu_k41KI,10937
|
|
31
|
+
ocrd/processor/ocrd_page_result.py,sha256=qo9pGV4r9S5--NAq5clIJOfs4b1vavoDOTbDqAEAAKA,507
|
|
32
|
+
ocrd/processor/builtin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
|
+
ocrd/processor/builtin/dummy_processor.py,sha256=SmMRtN0w88kBU24654ThT-yf84SFsFW4BOcmwsDDWdc,3533
|
|
34
|
+
ocrd/processor/builtin/filter_processor.py,sha256=9mbMq_XTJa8wrlbNdf46GUMNdjedz-enxafsCrnNhEo,4295
|
|
35
|
+
ocrd/processor/builtin/dummy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
36
|
+
ocrd/processor/builtin/dummy/ocrd-tool.json,sha256=NgMAXN1AQpGk4Ss73ThDY4QyFPKhj54qcrdeCGwTb10,2339
|
|
37
|
+
ocrd_modelfactory/__init__.py,sha256=sjAwPwDzetvPHdV6nPquHtMdFUBYRmo1P-VKER9YCWM,4404
|
|
38
|
+
ocrd_models/__init__.py,sha256=A0aj0mOraNb-xfiUueACdoaqISnp0qH-F49nTJg2vCs,380
|
|
39
|
+
ocrd_models/constants.py,sha256=R7-jOGabFd8HP0qRWfTMk0RcUmdwN-jhmDVbUW_QfU4,6961
|
|
40
|
+
ocrd_models/mets-empty.xml,sha256=dFixfbxSXrgjZx9BfdIKWHX-khNmp7dNYaFe2qQSwCY,1203
|
|
41
|
+
ocrd_models/ocrd_agent.py,sha256=fY3BQE7otU9KLHaKC9L7BjuU1PIXXTy17V-OAW8LzjI,5609
|
|
42
|
+
ocrd_models/ocrd_exif.py,sha256=HSLPn_WBDRIlMtKNYilLHm8WjX-b14HgnqT_KfzjS_0,4680
|
|
43
|
+
ocrd_models/ocrd_file.py,sha256=9-mfDb91RVy3p9rKryl-C39P4Of6Rb8OZBuxAee4VrI,9723
|
|
44
|
+
ocrd_models/ocrd_mets.py,sha256=lz9mlDq9A9UmZDoN8lh5XRnBzdAtLLZywDZSbyZPS84,50905
|
|
45
|
+
ocrd_models/ocrd_page.py,sha256=SRInM4HgcfDzbJH4ZO5B53ST2lAO7pgTXluwi0yzkf0,6211
|
|
46
|
+
ocrd_models/ocrd_page_generateds.py,sha256=IWoN3V-v3C4JgyPaFh9OQC87ob__wUP1Q6ELBxhLA1w,841794
|
|
47
|
+
ocrd_models/ocrd_xml_base.py,sha256=iOnDl2zBNhN-Q4moLWiFkSqXvfRzxE5wbp5Tjsu1W6A,1642
|
|
48
|
+
ocrd_models/report.py,sha256=CX-t9ZDi2VmAy8M1Azsh83UsvE_f5pMeEC7tPaA-ztU,2021
|
|
49
|
+
ocrd_models/utils.py,sha256=A-H11ZJ65ZjH4DPK9s_Yz6JtA9fbTQ2jY-__9s7Hrg8,2320
|
|
50
|
+
ocrd_models/xpath_functions.py,sha256=VM2f9hl8ja4NrDOEQRSYdx7GewwAxfoyGMDjqjgA_7g,1439
|
|
51
|
+
ocrd_network/__init__.py,sha256=w6uj3joSsg5NAzQPDsHkuwVjHXukO_JrvcAX07cBlHA,317
|
|
52
|
+
ocrd_network/client.py,sha256=pL-g79cQgulXyGYgLOh--oxl1hZEMu48PTbuvMW1jIE,3007
|
|
53
|
+
ocrd_network/client_utils.py,sha256=Ne1a0fteb-TBuc0EAD6X_fh2RAl4hmPt2oluhpB28iU,5371
|
|
54
|
+
ocrd_network/constants.py,sha256=iLHPX5H3g6QKhqIPXCNRILVG7eFUIWuuiBWKp0_dBLw,1812
|
|
55
|
+
ocrd_network/database.py,sha256=-SddvaMLKn0pjdONyvWmjxfPJd6viedAIp6Lj1sU1Zs,10705
|
|
56
|
+
ocrd_network/logging_utils.py,sha256=Ez5f_BRp0SiW2sP71yTT7zOJmuMzHYPLNWObq5fBLCw,2188
|
|
57
|
+
ocrd_network/param_validators.py,sha256=Jl1VwiPPKJ50k-xEHLdvW-1QDOkJHCiMz4k9Ipqm-Uc,1489
|
|
58
|
+
ocrd_network/process_helpers.py,sha256=t2qltUpRefzLwdSGsiUEOGYO4Pz2OH7arpgjmCAeXMU,3086
|
|
59
|
+
ocrd_network/processing_server.py,sha256=z21DvRleEeo0hkpc1-2z0jLKuf5WSipL95MVEns8eJE,38457
|
|
60
|
+
ocrd_network/processing_worker.py,sha256=5AtvIhfcePzltKj4SElh7Aj9zlUOEiMVPTjtXuFSbT8,12659
|
|
61
|
+
ocrd_network/server_cache.py,sha256=orfAMw3LwUnduRHFAB6MpfoORTDoPV4ntSdAcQHBOyI,13148
|
|
62
|
+
ocrd_network/server_utils.py,sha256=Lxby62gHvrSbHgpWXvyZGdsWajp2TFzyxjHdMZWBESk,10229
|
|
63
|
+
ocrd_network/tcp_to_uds_mets_proxy.py,sha256=yRW-O6ihd31gf7xqQBIBb_ZQQgqisMyOdRI216ehq_A,3160
|
|
64
|
+
ocrd_network/utils.py,sha256=yE-nV_sv171tPp7weIFOxYw6HJlxvGBmrS8b1rIHS7c,6760
|
|
65
|
+
ocrd_network/cli/__init__.py,sha256=7dzZLbGHaqMGToNZhll-q87Jh4UP6NSuvxbVuUOIkqY,228
|
|
66
|
+
ocrd_network/cli/client.py,sha256=H5fiJhBqbFn4_B2p3V20GejGTIYO-mNglh3y5nzUGhs,10350
|
|
67
|
+
ocrd_network/cli/processing_server.py,sha256=NsuI0f9h4KDwe39YugmHo5cJ_29chcLLQ7DThKfPO7s,770
|
|
68
|
+
ocrd_network/cli/processing_worker.py,sha256=ZuaCkbKV_WKJV7cGOjZ6RLrjjppymnwNCiznFMlclAg,1897
|
|
69
|
+
ocrd_network/models/__init__.py,sha256=eVYMZaktzlyHKx-zI7GLYyRlZd3Vi_lNgsqSSFwqb6U,475
|
|
70
|
+
ocrd_network/models/job.py,sha256=6NxcNIUHMS9Ft5UGWegngB6uNUOnE_6nOnRGKFbjI6A,4243
|
|
71
|
+
ocrd_network/models/messages.py,sha256=XnyLMX77NchgmtKJRtqtBFsk_sCR4OGEuWm_d3uDkj8,657
|
|
72
|
+
ocrd_network/models/workflow.py,sha256=GL8q7RX9fGdXG3iVyJpCeLXbWa-2qI_SIxqhzxs9VK8,189
|
|
73
|
+
ocrd_network/models/workspace.py,sha256=7kjCTY0ixqcyJP9eHnptkrJnPTCD3zFNfhApZz9w6OU,1568
|
|
74
|
+
ocrd_network/rabbitmq_utils/__init__.py,sha256=XLIqZhfin4I4m80G9B__UcP45Lz10_mEpMYLXGOByUk,741
|
|
75
|
+
ocrd_network/rabbitmq_utils/connector.py,sha256=N6mzjIf5FkVIno3FI1AksZY4F5jMUAm8baay0nXZx8w,11343
|
|
76
|
+
ocrd_network/rabbitmq_utils/constants.py,sha256=Zu_dKJASfrgnIvEZZlFX9uDR9y6w7zy0KhW7gP7wHDE,1063
|
|
77
|
+
ocrd_network/rabbitmq_utils/consumer.py,sha256=3WeryDmo0dSD9U0eLODbDElscvhEYjNeCBIewQHYfws,2488
|
|
78
|
+
ocrd_network/rabbitmq_utils/helpers.py,sha256=5G0wrBlDtmCItzp-fMZjYr1oeaqDUcii5qeyjXI-ilM,5372
|
|
79
|
+
ocrd_network/rabbitmq_utils/ocrd_messages.py,sha256=wwzfMWbXmOFo_nd32_XySCso91_Ul-aGm_GhGncNxD4,4419
|
|
80
|
+
ocrd_network/rabbitmq_utils/publisher.py,sha256=mw4XQQhRE1xUQVgEUseyG845iIgVO-9GdGwNH6nUFms,2433
|
|
81
|
+
ocrd_network/runtime_data/__init__.py,sha256=PnWuuagElbkTzGtPWQEk5wlFtDxqT7B48S0Zrgt8H68,320
|
|
82
|
+
ocrd_network/runtime_data/config_parser.py,sha256=Vr0FbsqmsoiuhDgZ7KFdeFZj9JvUulcOS2PCRFQQNHY,2364
|
|
83
|
+
ocrd_network/runtime_data/connection_clients.py,sha256=DZyAvkNyMaIddGJs56s2pMP_fK-XWAtICxk1cjvkWYM,4207
|
|
84
|
+
ocrd_network/runtime_data/deployer.py,sha256=j3tcauURZtu7MKcEIE9B5eMCMSYMbxhB8LmtK72Zk1c,5314
|
|
85
|
+
ocrd_network/runtime_data/hosts.py,sha256=n0azh_1XBc8-F9GtX-8q61iFzfxZjtjG-2D8qroihGA,7233
|
|
86
|
+
ocrd_network/runtime_data/network_agents.py,sha256=UKcAO1lMZkXgmhMbltBnRo1j7QVSbfDTxA52YrNqP2Y,3891
|
|
87
|
+
ocrd_network/runtime_data/network_services.py,sha256=5aH3RNGCi1fBuSdRp_Xz0MzyD_FmnvPnaBYAiYY3gp4,7891
|
|
88
|
+
ocrd_utils/__init__.py,sha256=gcO26xJ6dIUtJIvAr8wOe3CM4b7Revn07-DwEureoEc,5973
|
|
89
|
+
ocrd_utils/config.py,sha256=Oe8JBGb8r4z274XNWcdMV-GApzxmAYO8hHmbAV5bXf8,12609
|
|
90
|
+
ocrd_utils/constants.py,sha256=ImbG1d8t2MW3uuFi-mN6aY90Zn74liAKZBKlfuKN86w,3278
|
|
91
|
+
ocrd_utils/deprecate.py,sha256=luAqGWUSF-9DHmTd2lDiQoQPA5SrJazdoDPQYQ6A7Z4,1029
|
|
92
|
+
ocrd_utils/image.py,sha256=tG5WnNtrrvGjm2-r6NVs1Jm7z8fee3MuLKotAD6C2RU,24818
|
|
93
|
+
ocrd_utils/introspect.py,sha256=LPhgcUuoicQcURDCWlCpSdbfVyxID5vmQPXJ9vzuYV0,1977
|
|
94
|
+
ocrd_utils/logging.py,sha256=Kj_z92pXbzWmc0jMJ299Pup9hfcnzJH8ltvI9w7STZc,7824
|
|
95
|
+
ocrd_utils/ocrd_logging.conf,sha256=JlWmA_5vg6HnjPGjTC4mA5vFHqmnEinwllSTiOw5CCo,3473
|
|
96
|
+
ocrd_utils/os.py,sha256=GstXB4i3kDBy7PXU-TaPYV4BI-lkqd_cYKl6uDkVMkw,9829
|
|
97
|
+
ocrd_utils/str.py,sha256=4P0MdX0LCTqDTnsi_y5wNOBXW_TuTFANF7NYRXjo4x0,10136
|
|
98
|
+
ocrd_validators/__init__.py,sha256=ZFc-UqRVBk9o1YesZFmr9lOepttNJ_NKx1Zdb7g_YsU,972
|
|
99
|
+
ocrd_validators/bagit-profile.yml,sha256=sdQJlSi7TOn1E9WYMOZ1shewJ-i_nPaKmsAFkh28TGY,1011
|
|
100
|
+
ocrd_validators/constants.py,sha256=FLP57T3F39weka_XovG40RgVMW1GunnbK04QRQ9tmlE,1802
|
|
101
|
+
ocrd_validators/json_validator.py,sha256=rdsd7n2XxwL8Ow2fZvQ9cTv4tLG7JFRiInwylO9rabg,2655
|
|
102
|
+
ocrd_validators/message_processing.schema.yml,sha256=HL7o96-7ejslVMXcp16sbo5IjfUcW0wH8rPXHXdTyyA,1947
|
|
103
|
+
ocrd_validators/message_result.schema.yml,sha256=G6vt_JgIU7OGSaHj-2Jna6KWQ3bFWol5tnBArWEiVjM,681
|
|
104
|
+
ocrd_validators/mets.xsd,sha256=0Wrs9bObn0n-yEEIWyguIcUUuuP6KMEjD4I_p1_UlwY,138290
|
|
105
|
+
ocrd_validators/ocrd_network_message_validator.py,sha256=oafNWOjieBmTHFfYeCtyFFpW1gI0lDT6ycRr5Kvmfq0,561
|
|
106
|
+
ocrd_validators/ocrd_tool.schema.yml,sha256=BQkRIRDbn9B8gFeVxz_EpNdleh_x2dCtIpJEC4HqFHw,10125
|
|
107
|
+
ocrd_validators/ocrd_tool_validator.py,sha256=0DWuyyOSbdbrrQ5kEfWZv_qp5rSmLzmFMUKcPGfCBgM,749
|
|
108
|
+
ocrd_validators/ocrd_zip_validator.py,sha256=t-cYIZ5llZSQ2EspFzm0m-FajkLRfAFTISmXe27wMtA,3720
|
|
109
|
+
ocrd_validators/page.xsd,sha256=abQ8C3gRLPMFm8lH62aTCfvTIWI23TpgEDcaW9YCt7I,85770
|
|
110
|
+
ocrd_validators/page_validator.py,sha256=-xPlQb0WRv_wkpGdFFYRJFBoW2if3IYztu-7zeUKs_0,21813
|
|
111
|
+
ocrd_validators/parameter_validator.py,sha256=kZes2sl35iEjcewvyeW2aSXJC9tbMDLqVurH2IOYChU,1366
|
|
112
|
+
ocrd_validators/processing_server_config.schema.yml,sha256=s-cFCKxSNdxbtbuOhmATDrL1W-12CjhXq1n4PIAC_r8,4417
|
|
113
|
+
ocrd_validators/processing_server_config_validator.py,sha256=lQ2-ZxsvbFki_SvE_N4_1ptBnBHcwOTJ5grtL2G9F8A,810
|
|
114
|
+
ocrd_validators/resource_list_validator.py,sha256=vs6xOE8HFK6ha0UnEGMLRf29A2ODmS0b8QBeUhHQ8Qo,808
|
|
115
|
+
ocrd_validators/workspace_validator.py,sha256=h9SLNQKA7-BZJIWknM0FuaULXZtiRv2uqEVJV_6J9zI,20628
|
|
116
|
+
ocrd_validators/xlink.xsd,sha256=8fW7YAMWXN2PbB_MMvj9H5ZeFoEBDzuYBtlGC8_6ijw,3180
|
|
117
|
+
ocrd_validators/xsd_mets_validator.py,sha256=YgiuNtwNDtn3LuvdFFscnmsGREF_wQ4wtA76yE2Iljw,469
|
|
118
|
+
ocrd_validators/xsd_page_validator.py,sha256=ggt-nmaz-DDyAPwm3ZMVvtChuV2BJ2ZEEbWpePL9vTk,469
|
|
119
|
+
ocrd_validators/xsd_validator.py,sha256=ahJo_oVvTK_JB0Cu4CkMC8l_gbzsyW91AxGtelMjqrg,2115
|
|
120
|
+
ocrd-3.6.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
121
|
+
ocrd-3.6.0.dist-info/METADATA,sha256=Qc1Nap_yo-Y3_8FYaVIvGXV79q4NKrCZs6h4BEKXIg4,10523
|
|
122
|
+
ocrd-3.6.0.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
|
|
123
|
+
ocrd-3.6.0.dist-info/entry_points.txt,sha256=4hcJ2LkK_OlIabHnKgFit35Ap7b5Lz1Gb4hzkxV0Kiw,152
|
|
124
|
+
ocrd-3.6.0.dist-info/top_level.txt,sha256=pUgiN42t4KXC5rvpi6V8atza31XP4SCznXpXlVlvomM,75
|
|
125
|
+
ocrd-3.6.0.dist-info/RECORD,,
|
ocrd_modelfactory/__init__.py
CHANGED
|
@@ -40,7 +40,8 @@ def exif_from_filename(image_filename):
|
|
|
40
40
|
ocrd_exif = OcrdExif(pil_img)
|
|
41
41
|
return ocrd_exif
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
|
|
44
|
+
def page_from_image(input_file: Union[OcrdFile, ClientSideOcrdFile], **kwargs) -> OcrdPage:
|
|
44
45
|
"""
|
|
45
46
|
Create :py:class:`~ocrd_models.ocrd_page.OcrdPage`
|
|
46
47
|
from an :py:class:`~ocrd_models.ocrd_file.OcrdFile`
|
|
@@ -73,10 +74,11 @@ def page_from_image(input_file : Union[OcrdFile, ClientSideOcrdFile], **kwargs)
|
|
|
73
74
|
pcGtsId=input_file.ID
|
|
74
75
|
)
|
|
75
76
|
mapping = {}
|
|
76
|
-
etree
|
|
77
|
+
etree: ET._Element = pcgts.to_etree(mapping_=mapping)
|
|
77
78
|
revmap = dict(((node, element) for element, node in mapping.items()))
|
|
78
79
|
return OcrdPage(pcgts, etree, mapping, revmap)
|
|
79
80
|
|
|
81
|
+
|
|
80
82
|
def page_from_file(input_file, **kwargs) -> OcrdPage:
|
|
81
83
|
"""
|
|
82
84
|
Create :py:class:`~ocrd_models.ocrd_page.OcrdPage`
|
ocrd_models/constants.py
CHANGED
|
@@ -5,7 +5,7 @@ from re import Pattern
|
|
|
5
5
|
from enum import Enum, auto
|
|
6
6
|
from dataclasses import dataclass, field
|
|
7
7
|
from abc import ABC, abstractmethod
|
|
8
|
-
from typing import Any, List,
|
|
8
|
+
from typing import Any, List, Union
|
|
9
9
|
from ocrd_utils import resource_string
|
|
10
10
|
|
|
11
11
|
__all__ = [
|
|
@@ -107,14 +107,17 @@ class METS_PAGE_DIV_ATTRIBUTE(Enum):
|
|
|
107
107
|
@classmethod
|
|
108
108
|
def names(cls):
|
|
109
109
|
return [x.name for x in cls]
|
|
110
|
+
|
|
110
111
|
@classmethod
|
|
111
112
|
def type_prefix(cls):
|
|
112
113
|
"""disambiguation prefix to use for all subtypes"""
|
|
113
114
|
return "physical:"
|
|
115
|
+
|
|
114
116
|
def prefix(self):
|
|
115
117
|
"""disambiguation prefix to use for this attribute type"""
|
|
116
118
|
return self.type_prefix() + self.name.lower() + ":"
|
|
117
119
|
|
|
120
|
+
|
|
118
121
|
class METS_STRUCT_DIV_ATTRIBUTE(Enum):
|
|
119
122
|
"""page selection attributes of LOGICAL mets:structMap//mets:div"""
|
|
120
123
|
ID = auto()
|
|
@@ -125,14 +128,17 @@ class METS_STRUCT_DIV_ATTRIBUTE(Enum):
|
|
|
125
128
|
@classmethod
|
|
126
129
|
def names(cls):
|
|
127
130
|
return [x.name for x in cls]
|
|
131
|
+
|
|
128
132
|
@classmethod
|
|
129
133
|
def type_prefix(cls):
|
|
130
134
|
"""disambiguation prefix to use for all subtypes"""
|
|
131
135
|
return "logical:"
|
|
136
|
+
|
|
132
137
|
def prefix(self):
|
|
133
138
|
"""disambiguation prefix to use for this attribute type"""
|
|
134
139
|
return self.type_prefix() + self.name.lower() + ":"
|
|
135
140
|
|
|
141
|
+
|
|
136
142
|
@dataclass
|
|
137
143
|
class METS_DIV_ATTRIBUTE_PATTERN(ABC):
|
|
138
144
|
"""page selection pattern (abstract supertype)"""
|
|
@@ -161,22 +167,27 @@ class METS_DIV_ATTRIBUTE_PATTERN(ABC):
|
|
|
161
167
|
@abstractmethod
|
|
162
168
|
def _matches(self, input) -> bool:
|
|
163
169
|
return
|
|
170
|
+
|
|
164
171
|
def matches(self, input) -> bool:
|
|
165
172
|
"""does the selection pattern match on the given attribute value?"""
|
|
166
173
|
if (matched := self._matches(input)):
|
|
167
174
|
self.has_matched = True
|
|
168
175
|
return matched
|
|
169
176
|
|
|
177
|
+
|
|
170
178
|
@dataclass
|
|
171
179
|
class METS_DIV_ATTRIBUTE_ATOM_PATTERN(METS_DIV_ATTRIBUTE_PATTERN):
|
|
172
180
|
"""page selection pattern for literal (single value) matching"""
|
|
173
181
|
|
|
174
182
|
expr: str
|
|
183
|
+
|
|
175
184
|
def __repr__(self):
|
|
176
185
|
return "%s%s" % (self.attr_prefix(), self.expr)
|
|
186
|
+
|
|
177
187
|
def _matches(self, input):
|
|
178
188
|
return input == self.expr
|
|
179
189
|
|
|
190
|
+
|
|
180
191
|
@dataclass
|
|
181
192
|
class METS_DIV_ATTRIBUTE_RANGE_PATTERN(METS_DIV_ATTRIBUTE_PATTERN):
|
|
182
193
|
"""page selection pattern for interval (list expansion) matching"""
|
|
@@ -186,20 +197,26 @@ class METS_DIV_ATTRIBUTE_RANGE_PATTERN(METS_DIV_ATTRIBUTE_PATTERN):
|
|
|
186
197
|
"""first value of the range after expansion, before matching-exhausting"""
|
|
187
198
|
stop: str = field(init=False)
|
|
188
199
|
"""last value of the range after expansion, before matching-exhausting"""
|
|
200
|
+
|
|
189
201
|
def __post_init__(self):
|
|
190
202
|
self.start = self.expr[0]
|
|
191
203
|
self.stop = self.expr[-1]
|
|
204
|
+
|
|
192
205
|
def __repr__(self):
|
|
193
206
|
return "%s%s..%s" % (self.attr_prefix(), self.start, self.stop)
|
|
207
|
+
|
|
194
208
|
def _matches(self, input):
|
|
195
209
|
return input in self.expr
|
|
196
210
|
|
|
211
|
+
|
|
197
212
|
@dataclass
|
|
198
213
|
class METS_DIV_ATTRIBUTE_REGEX_PATTERN(METS_DIV_ATTRIBUTE_PATTERN):
|
|
199
214
|
"""page selection pattern for regular expression matching"""
|
|
200
215
|
|
|
201
216
|
expr: Pattern
|
|
217
|
+
|
|
202
218
|
def __repr__(self):
|
|
203
219
|
return "%s//%s" % (self.attr_prefix(), self.expr.pattern)
|
|
220
|
+
|
|
204
221
|
def _matches(self, input):
|
|
205
222
|
return bool(self.expr.fullmatch(input))
|
ocrd_models/ocrd_agent.py
CHANGED
|
@@ -5,6 +5,7 @@ API to ``mets:agent``
|
|
|
5
5
|
from .constants import NAMESPACES as NS, TAG_METS_AGENT, TAG_METS_NAME, TAG_METS_NOTE
|
|
6
6
|
from .ocrd_xml_base import ET
|
|
7
7
|
|
|
8
|
+
|
|
8
9
|
class OcrdAgent():
|
|
9
10
|
"""
|
|
10
11
|
Represents a <mets:agent>
|
|
@@ -195,4 +196,3 @@ class ClientSideOcrdAgent():
|
|
|
195
196
|
for k in ['type', 'othertype', 'role', 'otherrole', 'name']
|
|
196
197
|
])
|
|
197
198
|
return '<ClientSideOcrdAgent [' + props + ']/>'
|
|
198
|
-
|
ocrd_models/ocrd_exif.py
CHANGED
|
@@ -8,6 +8,7 @@ from subprocess import run, PIPE
|
|
|
8
8
|
from shutil import which
|
|
9
9
|
from ocrd_utils import getLogger
|
|
10
10
|
|
|
11
|
+
|
|
11
12
|
class OcrdExif():
|
|
12
13
|
"""Represents technical image metadata.
|
|
13
14
|
|
|
@@ -42,18 +43,21 @@ class OcrdExif():
|
|
|
42
43
|
if which('identify'):
|
|
43
44
|
self.run_identify(img)
|
|
44
45
|
else:
|
|
45
|
-
getLogger('ocrd.exif').warning("ImageMagick 'identify' not available,
|
|
46
|
+
getLogger('ocrd.exif').warning("ImageMagick 'identify' not available, "
|
|
47
|
+
"Consider installing ImageMagick for more robust pixel density estimation")
|
|
46
48
|
self.run_pil(img)
|
|
47
49
|
|
|
48
50
|
def run_identify(self, img):
|
|
49
51
|
for prop in ['compression', 'photometric_interpretation']:
|
|
50
52
|
setattr(self, prop, img.info[prop] if prop in img.info else None)
|
|
51
53
|
if img.filename:
|
|
52
|
-
ret = run(['identify', '-format', r'%[resolution.x] %[resolution.y] %U ', img.filename],
|
|
54
|
+
ret = run(['identify', '-format', r'%[resolution.x] %[resolution.y] %U ', img.filename],
|
|
55
|
+
check=False, stderr=PIPE, stdout=PIPE)
|
|
53
56
|
else:
|
|
54
57
|
with BytesIO() as bio:
|
|
55
58
|
img.save(bio, format=img.format)
|
|
56
|
-
ret = run(['identify', '-format', r'%[resolution.x] %[resolution.y] %U ', '/dev/stdin'],
|
|
59
|
+
ret = run(['identify', '-format', r'%[resolution.x] %[resolution.y] %U ', '/dev/stdin'],
|
|
60
|
+
check=False, stderr=PIPE, stdout=PIPE, input=bio.getvalue())
|
|
57
61
|
if ret.returncode:
|
|
58
62
|
stderr = ret.stderr.decode('utf-8')
|
|
59
63
|
if 'no decode delegate for this image format' in stderr:
|
ocrd_models/ocrd_file.py
CHANGED
|
@@ -6,9 +6,10 @@ from typing import Any, List, Optional, Union
|
|
|
6
6
|
|
|
7
7
|
from ocrd_utils import deprecation_warning
|
|
8
8
|
|
|
9
|
-
from .ocrd_xml_base import ET
|
|
9
|
+
from .ocrd_xml_base import ET # type: ignore
|
|
10
10
|
from .constants import NAMESPACES as NS, TAG_METS_FLOCAT
|
|
11
11
|
|
|
12
|
+
|
|
12
13
|
class OcrdFile():
|
|
13
14
|
"""
|
|
14
15
|
Represents a single ``mets:file/mets:FLocat`` (METS file entry).
|
|
@@ -62,11 +63,12 @@ class OcrdFile():
|
|
|
62
63
|
return '<OcrdFile fileGrp=%s %s]/> ' % (fileGrp, props)
|
|
63
64
|
|
|
64
65
|
def __eq__(self, other):
|
|
65
|
-
return self.ID == other.ID
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
return (self.ID == other.ID and
|
|
67
|
+
self.url == other.url and
|
|
68
|
+
self.local_filename == other.local_filename # and
|
|
69
|
+
# EXT_TO_MIME[MIME_TO_EXT[self.mimetype]] == EXT_TO_MIME[MIME_TO_EXT[other.mimetype]] and
|
|
70
|
+
# self.fileGrp == other.fileGrp
|
|
71
|
+
)
|
|
70
72
|
|
|
71
73
|
@property
|
|
72
74
|
def basename(self) -> str:
|
|
@@ -100,7 +102,7 @@ class OcrdFile():
|
|
|
100
102
|
return self._el.get('ID')
|
|
101
103
|
|
|
102
104
|
@ID.setter
|
|
103
|
-
def ID(self, ID
|
|
105
|
+
def ID(self, ID: Optional[str]) -> None:
|
|
104
106
|
"""
|
|
105
107
|
Set the ``@ID`` of the ``mets:file`` to :py:attr:`ID`.
|
|
106
108
|
"""
|
|
@@ -117,16 +119,18 @@ class OcrdFile():
|
|
|
117
119
|
@property
|
|
118
120
|
def pageId(self) -> str:
|
|
119
121
|
"""
|
|
120
|
-
Get the ``@ID`` of the physical ``mets:structMap`` entry corresponding to this ``mets:file``
|
|
122
|
+
Get the ``@ID`` of the physical ``mets:structMap`` entry corresponding to this ``mets:file``
|
|
123
|
+
(physical page manifestation).
|
|
121
124
|
"""
|
|
122
125
|
if self.mets is None:
|
|
123
126
|
raise Exception("OcrdFile %s has no member 'mets' pointing to parent OcrdMets" % self)
|
|
124
127
|
return self.mets.get_physical_page_for_file(self)
|
|
125
128
|
|
|
126
129
|
@pageId.setter
|
|
127
|
-
def pageId(self, pageId
|
|
130
|
+
def pageId(self, pageId: Optional[str]) -> None:
|
|
128
131
|
"""
|
|
129
|
-
Get the ``@ID`` of the physical ``mets:structMap`` entry corresponding to this ``mets:file``
|
|
132
|
+
Get the ``@ID`` of the physical ``mets:structMap`` entry corresponding to this ``mets:file``
|
|
133
|
+
(physical page manifestation) to :py:attr:`pageId`.
|
|
130
134
|
"""
|
|
131
135
|
if pageId is None:
|
|
132
136
|
return
|
|
@@ -139,7 +143,7 @@ class OcrdFile():
|
|
|
139
143
|
"""
|
|
140
144
|
Get the ``@LOCTYPE``s of the ``mets:file``.
|
|
141
145
|
"""
|
|
142
|
-
return [x.get('LOCTYPE') for x in
|
|
146
|
+
return [x.get('LOCTYPE') for x in self._el.findall('mets:FLocat', NS)]
|
|
143
147
|
|
|
144
148
|
@property
|
|
145
149
|
def mimetype(self) -> str:
|
|
@@ -149,7 +153,7 @@ class OcrdFile():
|
|
|
149
153
|
return self._el.get('MIMETYPE')
|
|
150
154
|
|
|
151
155
|
@mimetype.setter
|
|
152
|
-
def mimetype(self, mimetype
|
|
156
|
+
def mimetype(self, mimetype: Optional[str]) -> None:
|
|
153
157
|
"""
|
|
154
158
|
Set the ``@MIMETYPE`` of the ``mets:file`` to :py:attr:`mimetype`.
|
|
155
159
|
"""
|
|
@@ -178,7 +182,7 @@ class OcrdFile():
|
|
|
178
182
|
return ''
|
|
179
183
|
|
|
180
184
|
@url.setter
|
|
181
|
-
def url(self, url
|
|
185
|
+
def url(self, url: Optional[str]) -> None:
|
|
182
186
|
"""
|
|
183
187
|
Set the remote/original URL ``@xlink:href`` of this ``mets:file`` to :py:attr:`url`.
|
|
184
188
|
"""
|
|
@@ -203,7 +207,7 @@ class OcrdFile():
|
|
|
203
207
|
return None
|
|
204
208
|
|
|
205
209
|
@local_filename.setter
|
|
206
|
-
def local_filename(self, fname
|
|
210
|
+
def local_filename(self, fname: Optional[Union[Path, str]]):
|
|
207
211
|
"""
|
|
208
212
|
Set the local/cached ``@xlink:href`` of this ``mets:file`` to :py:attr:`local_filename`.
|
|
209
213
|
"""
|
|
@@ -230,12 +234,12 @@ class ClientSideOcrdFile:
|
|
|
230
234
|
|
|
231
235
|
def __init__(
|
|
232
236
|
self,
|
|
233
|
-
el,
|
|
237
|
+
el, # pylint: disable=unused-argument
|
|
234
238
|
mimetype: str = '',
|
|
235
239
|
pageId: str = '',
|
|
236
|
-
loctype: str ='OTHER',
|
|
240
|
+
loctype: str = 'OTHER',
|
|
237
241
|
local_filename: Optional[str] = None,
|
|
238
|
-
mets
|
|
242
|
+
mets: Any = None, # pylint: disable=unused-argument
|
|
239
243
|
url: str = '',
|
|
240
244
|
ID: str = '',
|
|
241
245
|
fileGrp: str = ''
|
|
@@ -248,8 +252,8 @@ class ClientSideOcrdFile:
|
|
|
248
252
|
mimetype (string): ``@MIMETYPE`` of this ``mets:file``
|
|
249
253
|
pageId (string): ``@ID`` of the physical ``mets:structMap`` entry corresponding to this ``mets:file``
|
|
250
254
|
loctype (string): ``@LOCTYPE`` of this ``mets:file``
|
|
251
|
-
url (string):
|
|
252
|
-
local_filename (): ``@xlink:href`` of this ``mets:file``
|
|
255
|
+
url (string): ``@xlink:href`` of this ``mets:file`` (if ``@LOCTYPE==URL``)
|
|
256
|
+
local_filename (): ``@xlink:href`` of this ``mets:file`` (if ``@LOCTYPE==FILE @OTHERLOCTYPE==FILE``)
|
|
253
257
|
ID (string): ``@ID`` of this ``mets:file``
|
|
254
258
|
"""
|
|
255
259
|
self.ID = ID
|
|
@@ -267,4 +271,5 @@ class ClientSideOcrdFile:
|
|
|
267
271
|
])
|
|
268
272
|
return '<ClientSideOcrdFile %s]/>' % (props)
|
|
269
273
|
|
|
274
|
+
|
|
270
275
|
OcrdFileType = Union[OcrdFile, ClientSideOcrdFile]
|