aspace-wb-scripts 0.1.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.
- aspace_wb/__init__.py +44 -0
- aspace_wb/cli/__init__.py +3 -0
- aspace_wb/cli/create_aspace_dos.py +14 -0
- aspace_wb/cli/create_blank_fillable.py +14 -0
- aspace_wb/cli/create_fillable.py +14 -0
- aspace_wb/cli/filled_to_wb.py +14 -0
- aspace_wb/cli/validate_filled.py +14 -0
- aspace_wb/core/__init__.py +3 -0
- aspace_wb/core/specs.py +348 -0
- aspace_wb/data/__init__.py +0 -0
- aspace_wb/data/fields/__init__.py +0 -0
- aspace_wb/data/fields/cnairaudio.csv +26 -0
- aspace_wb/data/fields/cnairbook.csv +26 -0
- aspace_wb/data/fields/cnairimage.csv +24 -0
- aspace_wb/data/fields/example_minimum_book.csv +11 -0
- aspace_wb/data/fields/example_minimum_single.csv +10 -0
- aspace_wb/data/vocabularies/__init__.py +0 -0
- aspace_wb/data/vocabularies/agents_in_AS.csv +175013 -0
- aspace_wb/data/vocabularies/cnair_subject.csv +601 -0
- aspace_wb/data/vocabularies/iso639.csv +8034 -0
- aspace_wb/data/vocabularies/relator.csv +268 -0
- aspace_wb/scripts/create_aspace_dos.py +101 -0
- aspace_wb/scripts/create_blank_fillable.py +154 -0
- aspace_wb/scripts/create_fillable.py +494 -0
- aspace_wb/scripts/filled_to_wb.py +242 -0
- aspace_wb/scripts/validate_filled.py +199 -0
- aspace_wb/utils/ISO639json_to_CSV.py +38 -0
- aspace_wb/utils/__init__.py +3 -0
- aspace_wb/utils/convert_data.py +303 -0
- aspace_wb/utils/default_specs.py +289 -0
- aspace_wb/utils/extract_dir.py +52 -0
- aspace_wb/utils/extract_file.py +73 -0
- aspace_wb/utils/use_CSVs.py +80 -0
- aspace_wb/utils/validate.py +295 -0
- aspace_wb_scripts-0.1.0.dist-info/METADATA +359 -0
- aspace_wb_scripts-0.1.0.dist-info/RECORD +39 -0
- aspace_wb_scripts-0.1.0.dist-info/WHEEL +4 -0
- aspace_wb_scripts-0.1.0.dist-info/entry_points.txt +6 -0
- aspace_wb_scripts-0.1.0.dist-info/licenses/LICENSE +21 -0
aspace_wb/__init__.py
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"""
|
|
2
|
+
ASpace Workbench Scripts Package
|
|
3
|
+
|
|
4
|
+
This package provides tools for American Philosophical Society (APS) staff to prepare
|
|
5
|
+
CSV files for ingesting files into Islandora 8 using Workbench. It automates metadata
|
|
6
|
+
extraction from media files and ArchivesSpace Bulk Update Spreadsheets.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
__version__ = "0.1.0"
|
|
10
|
+
__author__ = "American Philosophical Society"
|
|
11
|
+
__email__ = "cds@amphilsoc.org"
|
|
12
|
+
|
|
13
|
+
from .core.specs import *
|
|
14
|
+
|
|
15
|
+
__all__ = [
|
|
16
|
+
"FILESTOUPLOAD_DIR",
|
|
17
|
+
"METADATA_DIR",
|
|
18
|
+
"CV_DIR",
|
|
19
|
+
"FIELDS_DIR",
|
|
20
|
+
"AS_AGENTS_FILENAME",
|
|
21
|
+
"ISO639_FILENAME",
|
|
22
|
+
"CNAIR_SUBJECTS_FILENAME",
|
|
23
|
+
"RELATOR_CODES_FILENAME",
|
|
24
|
+
"LANGUAGE_NAMES",
|
|
25
|
+
"LANGUAGE_CODES",
|
|
26
|
+
"CNAIR_SUBJECTS",
|
|
27
|
+
"RELATOR_CODES",
|
|
28
|
+
"VALIDATE_ERROR_PREFIX",
|
|
29
|
+
"AS_DIGITAL_OBJECT_NODE_PREFIX",
|
|
30
|
+
"AS_DIGITAL_OBJECT_FILE_URI_PREFIX",
|
|
31
|
+
"BOOK_TITLE_URL_ALIAS_LENGTH",
|
|
32
|
+
"field_digital_origin",
|
|
33
|
+
"field_reformatting_quality",
|
|
34
|
+
"field_model_BOOK",
|
|
35
|
+
"field_resource_type_BOOK",
|
|
36
|
+
"file_SINGLE_PREFIX",
|
|
37
|
+
"url_alias_PREFIX",
|
|
38
|
+
"WB_FIELDS_REQUIRED_AT_INPUT_SINGLE",
|
|
39
|
+
"WB_FIELDS_REQUIRED_AT_INPUT_BOOK",
|
|
40
|
+
"WB_FIELDS_REQUIRED_AT_WORKBENCH_SINGLE",
|
|
41
|
+
"WB_FIELDS_REQUIRED_AT_WORKBENCH_BOOK",
|
|
42
|
+
"WB_FIELDS_ORDERED_WITH_DESCRIPTION",
|
|
43
|
+
"extension_to_WB_field",
|
|
44
|
+
]
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""
|
|
2
|
+
CLI entry point for create_aspace_dos command
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def main():
|
|
7
|
+
"""Entry point that calls the original Create_ASpace_DOs.py script"""
|
|
8
|
+
# Import and run the original script
|
|
9
|
+
from aspace_wb.scripts import create_aspace_dos # NOQA
|
|
10
|
+
# The original script runs on import, so we don't need to call anything
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
if __name__ == "__main__":
|
|
14
|
+
main()
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""
|
|
2
|
+
CLI entry point for create_blank_fillable command
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def main():
|
|
7
|
+
"""Entry point that calls the original Create_Blank_Fillable.py script"""
|
|
8
|
+
# Import and run the original script
|
|
9
|
+
from aspace_wb.scripts import create_blank_fillable # NOQA
|
|
10
|
+
# The original script runs on import, so we don't need to call anything
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
if __name__ == "__main__":
|
|
14
|
+
main()
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""
|
|
2
|
+
CLI entry point for create_fillable command
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def main():
|
|
7
|
+
"""Entry point that calls the original Create_Fillable.py script"""
|
|
8
|
+
# Import and run the original script
|
|
9
|
+
from aspace_wb.scripts import create_fillable # NOQA
|
|
10
|
+
# The original script runs on import, so we don't need to call anything
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
if __name__ == "__main__":
|
|
14
|
+
main()
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""
|
|
2
|
+
CLI entry point for filled_to_wb command
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def main():
|
|
7
|
+
"""Entry point that calls the original Filled_to_WB.py script"""
|
|
8
|
+
# Import and run the original script
|
|
9
|
+
from aspace_wb.scripts import filled_to_wb # NOQA
|
|
10
|
+
# The original script runs on import, so we don't need to call anything
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
if __name__ == "__main__":
|
|
14
|
+
main()
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""
|
|
2
|
+
CLI entry point for validate_filled command
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def main():
|
|
7
|
+
"""Entry point that calls the original Validate_Filled.py script"""
|
|
8
|
+
# Import and run the original script
|
|
9
|
+
from aspace_wb.scripts import validate_filled # NOQA
|
|
10
|
+
# The original script runs on import, so we don't need to call anything
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
if __name__ == "__main__":
|
|
14
|
+
main()
|
aspace_wb/core/specs.py
ADDED
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
"""
|
|
2
|
+
File defining constants, Workbench fields, and mappings between different fields
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import os
|
|
6
|
+
from importlib import resources
|
|
7
|
+
from aspace_wb.utils import use_CSVs
|
|
8
|
+
|
|
9
|
+
"""
|
|
10
|
+
Locations of files & directories; controlled vocabularies; misc
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
# directories and files
|
|
14
|
+
FILESTOUPLOAD_DIR = "files_to_upload"
|
|
15
|
+
METADATA_DIR = "metadata"
|
|
16
|
+
CV_DIR = "vocabularies" # controlled vocabularies
|
|
17
|
+
FIELDS_DIR = "fields"
|
|
18
|
+
AS_AGENTS_FILENAME = "agents_in_AS.csv"
|
|
19
|
+
ISO639_FILENAME = "iso639.csv"
|
|
20
|
+
CNAIR_SUBJECTS_FILENAME = "cnair_subject.csv"
|
|
21
|
+
RELATOR_CODES_FILENAME = "relator.csv"
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
# Package data paths
|
|
25
|
+
def get_package_data_path(data_type: str, filename: str) -> str:
|
|
26
|
+
"""Get path to package data file"""
|
|
27
|
+
import aspace_wb
|
|
28
|
+
|
|
29
|
+
return str(
|
|
30
|
+
resources.files(aspace_wb.__name__).joinpath("data", data_type, filename)
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
# controlled vocabularies, from the package data
|
|
35
|
+
LANGUAGE_NAMES = use_CSVs.CSV_col_to_list(
|
|
36
|
+
get_package_data_path("vocabularies", ISO639_FILENAME), 0
|
|
37
|
+
)
|
|
38
|
+
LANGUAGE_CODES = use_CSVs.CSV_col_to_list(
|
|
39
|
+
get_package_data_path("vocabularies", ISO639_FILENAME), 1
|
|
40
|
+
)
|
|
41
|
+
CNAIR_SUBJECTS = use_CSVs.CSV_col_to_list(
|
|
42
|
+
get_package_data_path("vocabularies", CNAIR_SUBJECTS_FILENAME), 0
|
|
43
|
+
)
|
|
44
|
+
RELATOR_CODES = use_CSVs.CSV_col_to_list(
|
|
45
|
+
get_package_data_path("vocabularies", RELATOR_CODES_FILENAME), 0
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
# other
|
|
49
|
+
VALIDATE_ERROR_PREFIX = "!! ERROR - "
|
|
50
|
+
AS_DIGITAL_OBJECT_NODE_PREFIX = "islandora8_"
|
|
51
|
+
AS_DIGITAL_OBJECT_FILE_URI_PREFIX = "https://diglib.amphilsoc.org/node/"
|
|
52
|
+
BOOK_TITLE_URL_ALIAS_LENGTH = 92
|
|
53
|
+
|
|
54
|
+
"""
|
|
55
|
+
Workbench fields
|
|
56
|
+
|
|
57
|
+
"""
|
|
58
|
+
|
|
59
|
+
# field defaults - ones with _BOOK are for book only
|
|
60
|
+
field_digital_origin = "Reformatted digital"
|
|
61
|
+
field_reformatting_quality = "Preservation"
|
|
62
|
+
field_model_BOOK = "Paged Content"
|
|
63
|
+
field_resource_type_BOOK = "Collection"
|
|
64
|
+
|
|
65
|
+
# field text prefixes (referencing locations within the upload server)
|
|
66
|
+
file_SINGLE_PREFIX = "/mnt/ingest/data/"
|
|
67
|
+
url_alias_PREFIX = "/islandora/object/"
|
|
68
|
+
|
|
69
|
+
# required fields that must exist in a "fields" csv BEFORE running create_fillable.py
|
|
70
|
+
WB_FIELDS_REQUIRED_AT_INPUT_SINGLE = (
|
|
71
|
+
"file",
|
|
72
|
+
"field_resource_type",
|
|
73
|
+
"field_model",
|
|
74
|
+
"field_member_of",
|
|
75
|
+
"title",
|
|
76
|
+
"field_digital_origin",
|
|
77
|
+
"field_parent_collection_call_num",
|
|
78
|
+
"field_collection2",
|
|
79
|
+
"field_collection_url",
|
|
80
|
+
"field_reformatting_quality",
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
WB_FIELDS_REQUIRED_AT_INPUT_BOOK = (
|
|
84
|
+
"file",
|
|
85
|
+
"field_resource_type",
|
|
86
|
+
"field_model",
|
|
87
|
+
"field_member_of",
|
|
88
|
+
"title",
|
|
89
|
+
"field_digital_origin",
|
|
90
|
+
"field_parent_collection_call_num",
|
|
91
|
+
"field_collection2",
|
|
92
|
+
"field_collection_url",
|
|
93
|
+
"field_reformatting_quality",
|
|
94
|
+
"total_scans",
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
# fields that will fill downwards through gaps
|
|
98
|
+
WB_FIELDS_DOWNFILLING = (
|
|
99
|
+
"field_member_of",
|
|
100
|
+
"field_collection2",
|
|
101
|
+
"field_parent_collection_call_num",
|
|
102
|
+
"field_collection_url",
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
# fields required after filled_to_wb.py to exist, even if/necessarily empty
|
|
106
|
+
WB_FIELDS_EXPORT_KEEP_EMPTY_SINGLE = ("field_member_of", "parent_id")
|
|
107
|
+
|
|
108
|
+
WB_FIELDS_EXPORT_KEEP_EMPTY_BOOK = (
|
|
109
|
+
"field_member_of",
|
|
110
|
+
"parent_id",
|
|
111
|
+
"field_weight",
|
|
112
|
+
"field_display_hints",
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
# fields that field_linked_agent gets split into and reformed from
|
|
116
|
+
# this is only called once out of several places it could be called (in which individual field names are typed out)
|
|
117
|
+
WB_field_linked_agent_SPLIT_FIELDS = (
|
|
118
|
+
"field_linked_agent_NAME",
|
|
119
|
+
"field_linked_agent_ROLE",
|
|
120
|
+
"field_linked_agent_TYPE",
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
# field names and their descriptions, as tuples
|
|
124
|
+
# 1. these display to the user in the Fillable sheet (not every field needs one or will display in that sheet)
|
|
125
|
+
# 2. the order here is the order that the Workbench csv will output
|
|
126
|
+
|
|
127
|
+
WB_FIELDS_ORDERED_WITH_DESCRIPTION = (
|
|
128
|
+
("file", "Name of file/folder. Autogenerated"),
|
|
129
|
+
("total_scans", "Number of scans in a book. Autogenerated"),
|
|
130
|
+
("field_resource_type", "Autogenerated"),
|
|
131
|
+
("field_model", "Autogenerated"),
|
|
132
|
+
(
|
|
133
|
+
"field_member_of",
|
|
134
|
+
"Existing collection node to place object under. LEAVE BLANK if creating new nodes. Fills down.",
|
|
135
|
+
),
|
|
136
|
+
("title", "Title of object"),
|
|
137
|
+
("field_metadata_title", ""),
|
|
138
|
+
("id", ""),
|
|
139
|
+
("parent_id", ""),
|
|
140
|
+
("field_weight", ""),
|
|
141
|
+
("field_display_hints", ""),
|
|
142
|
+
("field_alternative_title", ""),
|
|
143
|
+
("field_subtitle", ""),
|
|
144
|
+
("field_linked_agent", ""),
|
|
145
|
+
(
|
|
146
|
+
"field_linked_agent_NAME",
|
|
147
|
+
"Name part of linked agent. Consult Library of Congress. Pipe-separate.",
|
|
148
|
+
),
|
|
149
|
+
(
|
|
150
|
+
"field_linked_agent_ROLE",
|
|
151
|
+
"Role (relator code) part of linked agent. Pipe-separate, one for each of NAME",
|
|
152
|
+
),
|
|
153
|
+
(
|
|
154
|
+
"field_linked_agent_TYPE",
|
|
155
|
+
"Type part of linked agent. Leave blank if all are type 'person'. Otherwise pipe-separate abbreviations (p|c|f) or full (person|corporate_body|family), one for each NAME",
|
|
156
|
+
),
|
|
157
|
+
("field_speaker_affiliation", ""),
|
|
158
|
+
("field_family", ""),
|
|
159
|
+
("field_description_long", "Scope and Contents-style description"),
|
|
160
|
+
("field_conference", ""),
|
|
161
|
+
("field_table_of_contents", ""),
|
|
162
|
+
("field_note", "Additional note, e.g. caveats about scanning or metadata quality"),
|
|
163
|
+
("field_biographical_note", ""),
|
|
164
|
+
("field_genre", ""),
|
|
165
|
+
("field_physical_form", ""),
|
|
166
|
+
("field_edtf_date_created", "EDTF form of date (either this or text)"),
|
|
167
|
+
("field_date_created_text", "Text form of date (either this or EDTF)"),
|
|
168
|
+
("field_subject", ""),
|
|
169
|
+
("field_cnair_subject", "Consult csv here, Airtable, or Indigenous Subject Guide"),
|
|
170
|
+
("field_local_subject", ""),
|
|
171
|
+
("field_subject_olac", "Legacy CNAIR only. Not for new materials."),
|
|
172
|
+
("field_subjects_name", ""),
|
|
173
|
+
("field_geographic_subject", "Consult Library of Congress"),
|
|
174
|
+
("field_coordinates", ""),
|
|
175
|
+
("field_temporal_subject", ""),
|
|
176
|
+
("field_language", "ISO639 language names and codes. Enter either."),
|
|
177
|
+
("field_olac_discourse_type", ""),
|
|
178
|
+
("field_olac_linguistic_type", ""),
|
|
179
|
+
("field_place2", ""),
|
|
180
|
+
("field_publisher", ""),
|
|
181
|
+
("field_place_published", ""),
|
|
182
|
+
("field_extent", "Autogenerated if possible"),
|
|
183
|
+
("field_legacy_identifier", ""),
|
|
184
|
+
(
|
|
185
|
+
"field_original_format",
|
|
186
|
+
"See https://diglib.amphilsoc.org/taxonomy/vocab/original_format/all (first letter capitalized only)",
|
|
187
|
+
),
|
|
188
|
+
("field_digital_origin", "Value assumed. Change if incorrect."),
|
|
189
|
+
("field_reformatting_quality", "Value assumed. Change if incorrect."),
|
|
190
|
+
("field_legacy_model", ""),
|
|
191
|
+
(
|
|
192
|
+
"field_date_digitized",
|
|
193
|
+
"Date digitized, estimated from file metadata. Change if you know this to be wrong.",
|
|
194
|
+
),
|
|
195
|
+
("field_date_modified", ""),
|
|
196
|
+
(
|
|
197
|
+
"field_recording_number",
|
|
198
|
+
"Legacy audio only. Use field_local_identifier for new audio.",
|
|
199
|
+
),
|
|
200
|
+
(
|
|
201
|
+
"field_program_number",
|
|
202
|
+
"Legacy audio only. Use field_local_identifier for new audio.",
|
|
203
|
+
),
|
|
204
|
+
("field_legacy_type", ""),
|
|
205
|
+
("field_classification", ""),
|
|
206
|
+
("field_edition", ""),
|
|
207
|
+
("field_collection2", "Collection title, e.g. John Tukey Papers. Fills down."),
|
|
208
|
+
(
|
|
209
|
+
"field_parent_collection_call_num",
|
|
210
|
+
"Collection call number e.g. Mss.Ms.Coll.42. Fills down.",
|
|
211
|
+
),
|
|
212
|
+
(
|
|
213
|
+
"field_collection_url",
|
|
214
|
+
"Collection URL, e.g. https://as.amphilsoc.org/repositories/2/resources/3085. Fills down.",
|
|
215
|
+
),
|
|
216
|
+
("field_restrictions_on_access", ""),
|
|
217
|
+
("field_mods_relateditem_titleinfo", "Collection title to relate to this object"),
|
|
218
|
+
("field_related_materials_note", "Note on related collection"),
|
|
219
|
+
("field_related_resource_url", "Collection URL to relate to this object"),
|
|
220
|
+
("field_related_object", "DigLib node to relate to this object"),
|
|
221
|
+
("field_access_restricted", ""),
|
|
222
|
+
("field_mods_subject_displaylabel", ""),
|
|
223
|
+
("field_administrative_notes", "Internal (non-public) note"),
|
|
224
|
+
(
|
|
225
|
+
"field_access_terms",
|
|
226
|
+
"Uploading restricted items is not yet worked out. Autogenerated for audio.",
|
|
227
|
+
),
|
|
228
|
+
("TEI", ""),
|
|
229
|
+
("url_alias", "An alternate URL, for long/repeated titles. Prefix will be filled."),
|
|
230
|
+
(
|
|
231
|
+
"field_local_identifier",
|
|
232
|
+
"Equivalent to Component Unique Identifier. Use for alternate (non-title/chrono) arrangement in a collection.",
|
|
233
|
+
),
|
|
234
|
+
(
|
|
235
|
+
"field_internet_media_type",
|
|
236
|
+
"Media Type, a file format identification standard. Autogenerated",
|
|
237
|
+
),
|
|
238
|
+
)
|
|
239
|
+
|
|
240
|
+
# all the above fields as a list, for simpler access
|
|
241
|
+
WB_FIELDS_ALL = [x[0] for x in WB_FIELDS_ORDERED_WITH_DESCRIPTION]
|
|
242
|
+
|
|
243
|
+
# File extensions to Workbench values
|
|
244
|
+
# This is fairly repetitive as field_display_hints and field_internet_media_type are based on specific extensions
|
|
245
|
+
# for field_internet_media_type standard consult https://www.iana.org/assignments/media-types/media-types.xhtml and/or https://mimetype.io
|
|
246
|
+
# (for some reason these are distinct. wav is not included in IANA.)
|
|
247
|
+
# field_access_terms, field_model and field_resource_type always come in a group
|
|
248
|
+
extension_to_WB_field = (
|
|
249
|
+
{
|
|
250
|
+
"extension": ".wav",
|
|
251
|
+
"field_access_terms": "Restricted Audio",
|
|
252
|
+
"field_display_hints": None,
|
|
253
|
+
"field_model": "Audio",
|
|
254
|
+
"field_resource_type": "Sound",
|
|
255
|
+
"field_internet_media_type": "audio/wav", # https://mimetype.io/audio/vnd.wav official but apparently less supported than audio/wav, see discussion on linked github page
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"extension": ".mp3",
|
|
259
|
+
"field_access_terms": "Restricted Audio",
|
|
260
|
+
"field_display_hints": None,
|
|
261
|
+
"field_model": "Audio",
|
|
262
|
+
"field_resource_type": "Sound",
|
|
263
|
+
"field_internet_media_type": "audio/mpeg",
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"extension": ".pdf",
|
|
267
|
+
"field_access_terms": None,
|
|
268
|
+
"field_display_hints": "PDFjs",
|
|
269
|
+
"field_model": "Digital Document",
|
|
270
|
+
"field_resource_type": "Collection",
|
|
271
|
+
"field_internet_media_type": "application/pdf",
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"extension": ".tif",
|
|
275
|
+
"field_model": "Image",
|
|
276
|
+
"field_access_terms": None,
|
|
277
|
+
"field_display_hints": "Open Seadragon",
|
|
278
|
+
"field_resource_type": "Still Image",
|
|
279
|
+
"field_internet_media_type": "image/tiff",
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
"extension": ".jpg",
|
|
283
|
+
"field_model": "Image",
|
|
284
|
+
"field_access_terms": None,
|
|
285
|
+
"field_display_hints": "Open Seadragon",
|
|
286
|
+
"field_resource_type": "Still Image",
|
|
287
|
+
"field_internet_media_type": "image/jpeg",
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"extension": ".jp2",
|
|
291
|
+
"field_model": "Image",
|
|
292
|
+
"field_access_terms": None,
|
|
293
|
+
"field_display_hints": "Open Seadragon",
|
|
294
|
+
"field_resource_type": "Still Image",
|
|
295
|
+
"field_internet_media_type": "image/jp2",
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
"extension": ".mp4",
|
|
299
|
+
"field_model": "Video",
|
|
300
|
+
"field_access_terms": None,
|
|
301
|
+
"field_display_hints": None,
|
|
302
|
+
"field_resource_type": "Moving Image",
|
|
303
|
+
"field_internet_media_type": "video/mp4",
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"extension": ".mov",
|
|
307
|
+
"field_model": "Video",
|
|
308
|
+
"field_access_terms": None,
|
|
309
|
+
"field_display_hints": None,
|
|
310
|
+
"field_resource_type": "Moving Image",
|
|
311
|
+
"field_internet_media_type": "video/quicktime",
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
"extension": ".mts",
|
|
315
|
+
"field_model": "Video",
|
|
316
|
+
"field_access_terms": None,
|
|
317
|
+
"field_display_hints": None,
|
|
318
|
+
"field_resource_type": "Moving Image",
|
|
319
|
+
"field_internet_media_type": "video/MP2T",
|
|
320
|
+
},
|
|
321
|
+
)
|
|
322
|
+
|
|
323
|
+
# list of extensions, for simple access
|
|
324
|
+
EXTENSIONS = [x["extension"] for x in extension_to_WB_field]
|
|
325
|
+
|
|
326
|
+
"""
|
|
327
|
+
Check that runs on any use, to validate that all Workbench fields referenced are in WB_FIELDS_ALL
|
|
328
|
+
this will flag an error if we update the fields but forget something
|
|
329
|
+
"""
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
def _WB_fields_consistency_check():
|
|
333
|
+
for x in (
|
|
334
|
+
WB_FIELDS_REQUIRED_AT_INPUT_SINGLE,
|
|
335
|
+
WB_FIELDS_REQUIRED_AT_INPUT_BOOK,
|
|
336
|
+
WB_FIELDS_DOWNFILLING,
|
|
337
|
+
WB_FIELDS_EXPORT_KEEP_EMPTY_SINGLE,
|
|
338
|
+
WB_FIELDS_EXPORT_KEEP_EMPTY_BOOK,
|
|
339
|
+
):
|
|
340
|
+
for y in x:
|
|
341
|
+
if y not in WB_FIELDS_ALL:
|
|
342
|
+
raise ValueError(
|
|
343
|
+
"Workbench fields error: this field is referenced in one WB_FIELDS tuple but not WB_FIELDS_ALL: "
|
|
344
|
+
+ str(y)
|
|
345
|
+
)
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
_WB_fields_consistency_check()
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
file
|
|
2
|
+
field_collection2
|
|
3
|
+
field_parent_collection_call_num
|
|
4
|
+
field_collection_url
|
|
5
|
+
field_member_of
|
|
6
|
+
field_local_identifier
|
|
7
|
+
title
|
|
8
|
+
url_alias
|
|
9
|
+
field_edtf_date_created
|
|
10
|
+
field_date_created_text
|
|
11
|
+
field_original_format
|
|
12
|
+
field_extent
|
|
13
|
+
field_description_long
|
|
14
|
+
field_note
|
|
15
|
+
field_cnair_subject
|
|
16
|
+
field_language
|
|
17
|
+
field_geographic_subject
|
|
18
|
+
field_linked_agent
|
|
19
|
+
field_related_materials_note
|
|
20
|
+
field_mods_relateditem_titleinfo
|
|
21
|
+
field_related_resource_url
|
|
22
|
+
field_date_digitized
|
|
23
|
+
field_resource_type
|
|
24
|
+
field_model
|
|
25
|
+
field_digital_origin
|
|
26
|
+
field_reformatting_quality
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
file
|
|
2
|
+
field_collection2
|
|
3
|
+
field_parent_collection_call_num
|
|
4
|
+
field_collection_url
|
|
5
|
+
field_member_of
|
|
6
|
+
field_local_identifier
|
|
7
|
+
title
|
|
8
|
+
url_alias
|
|
9
|
+
field_edtf_date_created
|
|
10
|
+
field_date_created_text
|
|
11
|
+
field_description_long
|
|
12
|
+
field_note
|
|
13
|
+
field_cnair_subject
|
|
14
|
+
field_language
|
|
15
|
+
field_geographic_subject
|
|
16
|
+
field_linked_agent
|
|
17
|
+
field_related_materials_note
|
|
18
|
+
field_mods_relateditem_titleinfo
|
|
19
|
+
field_related_resource_url
|
|
20
|
+
field_extent
|
|
21
|
+
total_scans
|
|
22
|
+
field_date_digitized
|
|
23
|
+
field_resource_type
|
|
24
|
+
field_model
|
|
25
|
+
field_digital_origin
|
|
26
|
+
field_reformatting_quality
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
file
|
|
2
|
+
field_collection2
|
|
3
|
+
field_parent_collection_call_num
|
|
4
|
+
field_collection_url
|
|
5
|
+
field_member_of
|
|
6
|
+
field_local_identifier
|
|
7
|
+
title
|
|
8
|
+
url_alias
|
|
9
|
+
field_edtf_date_created
|
|
10
|
+
field_date_created_text
|
|
11
|
+
field_description_long
|
|
12
|
+
field_note
|
|
13
|
+
field_cnair_subject
|
|
14
|
+
field_language
|
|
15
|
+
field_geographic_subject
|
|
16
|
+
field_linked_agent
|
|
17
|
+
field_related_materials_note
|
|
18
|
+
field_mods_relateditem_titleinfo
|
|
19
|
+
field_related_resource_url
|
|
20
|
+
field_date_digitized
|
|
21
|
+
field_resource_type
|
|
22
|
+
field_model
|
|
23
|
+
field_digital_origin
|
|
24
|
+
field_reformatting_quality
|
|
File without changes
|