Handle namePart + nameIdentifier

master
Gerber, Mike 3 years ago
parent c49ac4f6e8
commit 93ce1505c4

@ -330,6 +330,14 @@ def mods_to_dict(mods, raise_errors=True):
.is_singleton().has_attributes({'authority': 'marcrelator', 'type': 'code'}) \ .is_singleton().has_attributes({'authority': 'marcrelator', 'type': 'code'}) \
.text() .text()
elif tag == '{http://www.loc.gov/mods/v3}namePart': elif tag == '{http://www.loc.gov/mods/v3}namePart':
for e in group:
if not e.attrib.get('type'):
value['namePart'] = e.text
else:
value['namePart-{}'.format(e.attrib['type'])] = e.text
elif tag == '{http://www.loc.gov/mods/v3}nameIdentifier':
# TODO Use this (e.g. <mods:nameIdentifier type="ppn">106168096</mods:nameIdentifier>) or the
# mods:name@valueURI to disambiguate
pass pass
elif tag == '{http://www.loc.gov/mods/v3}displayForm': elif tag == '{http://www.loc.gov/mods/v3}displayForm':
value['displayForm'] = TagGroup(tag, group).is_singleton().has_no_attributes().text() value['displayForm'] = TagGroup(tag, group).is_singleton().has_no_attributes().text()

Loading…
Cancel
Save