xbrl.UnitAspectValue

An xbrl.UnitAspectValue class represents a particular value for the unit aspect.

class xbrl.UnitAspectValue(numerator, denominator=None)

Constructs a new unit aspect value with the given numerator and denominator qnames as measures.

Class methods

classmethod xbrl.UnitAspectValue.from_iso4217_currency(type cls, designator)

Constructs a new monetary unit aspect value with the given currency designator.

classmethod xbrl.UnitAspectValue.from_qname(type cls, qname)

Constructs a new simple unit aspect value with the given qname as its measure.

Attributes

xbrl.UnitAspectValue.aspect

Returns xbrl.Aspect.UNIT.

xbrl.UnitAspectValue.denominator

Returns an iterator of xml.QName objects which represent the measures in the unit’s denominator.

xbrl.UnitAspectValue.iso4217_currency

Returns the ISO 4217 currency designator as string. A TypeError is raised if the unit is not a monetary unit. Raises an AttributeError for non-monetary units.

xbrl.UnitAspectValue.numerator

Returns an iterator of xml.QName objects which represent the measures in the unit’s numerator.

Methods

xbrl.UnitAspectValue.is_monetary()

Returns True if the unit aspect value is a simple unit containing an ISO 4217 currency measure.

xbrl.UnitAspectValue.is_pure()

Returns True if the unit aspect value is a simple unit containing a xbrli:pure measure.

xbrl.UnitAspectValue.is_shares()

Returns True if the unit aspect value is a simple unit containing a xbrli:shares measure.

xbrl.UnitAspectValue.is_simple()

Returns True if the unit aspect value has only a single measure in the numerator and an absent denominator.

Special methods

__bool__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__