INNER CODE UNIT · Python
get_metadata_attribute
guma44/GEOparse · src/GEOparse/GEOTypes.py:100
def get_metadata_attribute(self, metaname):
"""Get the metadata attribute by the name.
Args:
metaname (:obj:`str`): Name of the attribute
Returns:
:obj:`list` or :obj:`str`: Value(s) of the requested metadata
attribute
Raises:
NoMetadataException: Attribute error
TypeError: Metadata should be a list
"""
metadata_value = self.metadata.get(metaname, None)
if metadata_value is None:
raise NoMetadataException("No metadata attribute named %s" % metaname)
if not isinstance(metadata_value, list):