Right now, it is difficult to access attributes of collections of elements within a PREMISElement instance. For example, to get the premis:relationshipSubType value of all premis:relationship elements in a PREMISObject with current metsrw.plugins.premisrw, the following is necessary::
>>> for relationship in premis_object.relationship:
... try:
... sub_type = [el for el in relationship if el[0] == 'relationship_sub_type'][0][1]
... except IndexError:
... sub_type = None
It would be better if something like the following were possible:
>>> for relationship in premis_object.relationship:
... sub_type = relationship.sub_type
Right now, it is difficult to access attributes of collections of elements within a
PREMISElement
instance. For example, to get thepremis:relationshipSubType
value of allpremis:relationship
elements in aPREMISObject
with current metsrw.plugins.premisrw, the following is necessary::It would be better if something like the following were possible: