@@ -116,6 +116,9 @@ def extract_json(tree):
116116 # summary: from msContents/summary or profileDesc/abstract
117117 summary = first_text (root , ".//tei:msContents/tei:summary | .//tei:profileDesc/tei:abstract" )
118118
119+ # contents note: from head/note[@type='contents-note']
120+ contents_note = first_text (root , ".//tei:head/tei:note[@type='contents-note']" )
121+
119122 # persName: collect person names in tei:persName nodes (serialize inner markup if present)
120123 pers_nodes = root .xpath (".//tei:persName" , namespaces = NS )
121124 pers_list = []
@@ -134,6 +137,11 @@ def extract_json(tree):
134137 # shelfmark: altIdentifier idno type=BL-Shelfmark or altIdentifier/ idno content
135138 shelfmarks = text_list (root , ".//tei:altIdentifier/tei:idno[@type='BL-Shelfmark'] | .//tei:altIdentifier/tei:idno | .//tei:msIdentifier//tei:idno[@type='BL-Shelfmark']" )
136139
140+ # Wright entry number: from msIdentifier/altIdentifier/idno[@type='Wright-BL-Roman']
141+ wright_num = first_text (root , ".//tei:msIdentifier//tei:altIdentifier//tei:idno[@type='Wright-BL-Roman']" )
142+ if wright_num :
143+ wright_num = f"[Wright { wright_num } ]"
144+
137145 # finalRubrics
138146 final_rubrics = []
139147 for el in root .xpath (".//tei:finalRubric" , namespaces = NS ):
@@ -172,6 +180,14 @@ def extract_json(tree):
172180 else :
173181 material = first_text (root , ".//tei:physDesc//tei:objectDesc//tei:supportDesc//tei:material | .//tei:objectDesc//tei:supportDesc//tei:material | .//tei:physDesc//tei:supportDesc//tei:material | .//tei:physDesc//tei:supportDesc//tei:support//tei:material" )
174182
183+ # form: from physDesc/objectDesc/@form, capitalized
184+ form = first_text (root , ".//tei:physDesc//tei:objectDesc/@form" )
185+ if form :
186+ form = form .capitalize ()
187+
188+ # extent: from physDesc/objectDesc/supportDesc/extent/measure (text or @quantity)
189+ extent = first_text (root , ".//tei:physDesc//tei:objectDesc//tei:supportDesc//tei:extent//tei:measure" )
190+
175191 # classification: collect descs under listRelation or relation descs (e.g., "Old Testament")
176192 classification = text_list (root , ".//tei:listRelation//tei:relation/tei:desc | .//tei:listRelation//tei:desc | .//tei:listRelation//tei:relation/tei:desc" )
177193
@@ -206,16 +222,20 @@ def extract_json(tree):
206222 if idno : out ["idno" ] = idno
207223 out ["displayTitleEnglish" ] = display_title_english or ""
208224 if summary : out ["summary" ] = summary
225+ if contents_note : out ["contentsNote" ] = contents_note
209226 if pers_list : out ["persName" ] = pers_list
210227 if place_list : out ["placeName" ] = place_list
211228 if origin_place_list : out ["origPlace" ] = origin_place_list
212229 if shelfmarks : out ["shelfmark" ] = shelfmarks
230+ if wright_num : out ["wrightEntry" ] = wright_num
213231 if final_rubrics : out ["finalRubrics" ] = final_rubrics
214232 if colophons : out ["colophons" ] = colophons
215233 if other_limit : out ["otherLimit" ] = other_limit
216234 if script_val : out ["script" ] = script_val
217235 if script_lang : out ["scriptLanguage" ] = script_lang
218236 if material : out ["material" ] = material
237+ if form : out ["form" ] = form
238+ if extent : out ["extent" ] = extent
219239 if classification : out ["classification" ] = classification
220240 if orig_dates : out ["origDate" ] = orig_dates
221241 if date_not_before : out ["dateNotBefore" ] = date_not_before
0 commit comments