hec.rating.simple_rating

Exception class for SimpleRating objects

Provides common for definitions and code for TableRating and ExpressionRating classes, both of which are represented in XML using the tag.

@staticmethod
def from_xml( xml_str: str, specification: Optional[hec.rating.RatingSpecification] = None) -> hec.rating.AbstractRating:

Creates a rating object from an XML instance

Arguments:
  • xml_str (str): The XML instance to create the rating from
Raises:
  • AbstractRatingException: if no subclass of AbstractRating has a registered from_xml()
  • method that is compatible with the specified XML instance
Returns:

AbstractRating: The rating created from the XML instance

xml_element: lxml.etree._Element

The rating as an lxml.etree.Element object

Operations:

Read-Only

def xml_tag_name(self) -> str:

The XML tag name for this rating type

Oprations:

Read-Only