dj_angles.mappers.utils¶
Module Contents¶
- dj_angles.mappers.utils.get_attribute_value_or_first_key(tag: dj_angles.tags.Tag, attribute_name: str) str ¶
Gets the first attribute key or the first value for a particular attribute name.
As a side effect of this function, if the attribute is found, it will be removed from tag.attributes because almost always that is the desired behavior. tag.parse_attributes() can be called for the tag if needed for future needs, i.e. when in an end tag and needing the attributes for a start tag.
- Parameters:
tag (param) – The tag to get attributes from.
attribute_name (param) – The name of the attribute to get.