pyxx.units.UnitConverterEntry¶
- class pyxx.units.UnitConverterEntry(unit: Unit, tags: TypedList[str] | List[str] | Tuple[str, ...] | str | None = None, name: str | None = None, description: str | None = None)¶
Bases:
objectData structure for storing information about a unit in a unit converter
The
UnitConverterEntryis designed to be used in combination with aUnitConverterobject. AUnitConverterEntryobject stores data about a particular unit, allowing such information to be grouped and changes to the data validated. Many such objects are stored in in aUnitConverter, allowing it to relate and perform conversions between different units, while the “lower-level” details of managing unit data are handled byUnitConverterEntry.Attributes
A description of the unit
A name by which to reference the unit
Tags that associate the unit with various categories or groups
A
Unitobject representing the unitMethods
__init__(unit[, tags, name, description])Creates a
UnitConverterEntryto store data about a particular unit- __init__(unit: Unit, tags: TypedList[str] | List[str] | Tuple[str, ...] | str | None = None, name: str | None = None, description: str | None = None) None¶
Creates a
UnitConverterEntryto store data about a particular unit- Parameters:
tags (TypedList or list or tuple or str, optional) – One or more strings containing brief, one-word descriptors to use to group similar units, such as “length” or “speed” (default is
None, meaning that no tags are associated with the unit)name (str, optional) – A name for the unit (default is
None)description (str, optional) – A written description of the unit (default is
None)
- property description: str | None¶
A description of the unit
- property name: str | None¶
A name by which to reference the unit