Skip to content

Commit feb8d09

Browse files
committed
🧹 MODS: Filter UUID
1 parent c25de38 commit feb8d09

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/mods4pandas/mods4pandas.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,16 @@ def has_event_type(origin_info):
162162
.descend(raise_errors)
163163
)
164164
elif tag == "{http://www.loc.gov/mods/v3}recordIdentifier":
165+
def no_uuid(record_identifier):
166+
return record_identifier.attrib.get("type") != "uuid"
167+
165168
# By default we assume source="gbv-ppn" mods:recordIdentifiers (= PPNs),
166169
# however, in mods:relatedItems, there may be source="dnb-ppns",
167170
# which we need to distinguish by using a separate field name.
168171
try:
169172
value["recordIdentifier"] = (
170173
TagGroup(tag, group)
174+
.filter(no_uuid)
171175
.is_singleton()
172176
.has_attributes({"source": "gbv-ppn"})
173177
.text()

0 commit comments

Comments
 (0)