mirror of
				https://github.com/qurator-spk/modstool.git
				synced 2025-11-04 11:24:14 +01:00 
			
		
		
		
	✨ Handle namePart + nameIdentifier
This commit is contained in:
		
							parent
							
								
									c49ac4f6e8
								
							
						
					
					
						commit
						93ce1505c4
					
				
					 1 changed files with 8 additions and 0 deletions
				
			
		| 
						 | 
					@ -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…
	
	Add table
		Add a link
		
	
		Reference in a new issue