Unit Catalog

Units

AsyncCogniteClient.units.from_alias(alias[, ...])

Look up a unit by alias, optionally for a given quantity.

AsyncCogniteClient.units.list()

List all supported units.

AsyncCogniteClient.units.retrieve(external_id)

Retrieve one or more unit.

Unit Systems

AsyncCogniteClient.units.systems.list()

List all supported unit systems

Unit data classes

class cognite.client.data_classes.units.Unit(
external_id: str,
name: str,
long_name: str,
symbol: str,
alias_names: list[str],
quantity: str,
conversion: UnitConversion,
source: str | None = None,
source_reference: str | None = None,
)

Bases: CogniteResource

This class represents a Unit in CDF.

Parameters:
  • external_id (str) – A unique identifier of the unit.

  • name (str) – The name of the unit, e.g. DEG_C for Celsius.

  • long_name (str) – A more descriptive name of the unit, e.g., degrees Celsius.

  • symbol (str) – The symbol of the unit, e.g., °C.

  • alias_names (list[str]) – List of alias names for the unit, e.g., Degree C, degC, °C, and so on.

  • quantity (str) – The quantity of the unit, e.g., temperature.

  • conversion (UnitConversion) – The conversion between the unit and its base unit. For example, the base unit for temperature is Kelvin, and the conversion from Celsius to Kelvin is multiplier = 1, offset = 273.15.

  • source (str | None) – The source of the unit, e.g., qudt.org

  • source_reference (str | None) – The reference to the source of the unit, e.g., http://qudt.org/vocab/unit/DEG_C

as_unit_id() UnitID

Returns the UnitID of this unit.

dump(camel_case: bool = True) dict[str, Any]

Dump the instance into a json serializable Python data type.

Parameters:

camel_case (bool) – Use camelCase for attribute names. Defaults to True.

Returns:

A dictionary representation of the instance.

Return type:

dict[str, Any]

class cognite.client.data_classes.units.UnitConversion(multiplier: float, offset: float)

Bases: object

The conversion between a unit and its base unit.

Parameters:
  • multiplier (float) – The multiplier to convert from the unit to the base unit.

  • offset (float) – The offset to convert from the unit to the base unit.

class cognite.client.data_classes.units.UnitID(unit_external_id: str, name: str)

Bases: CogniteResource

Unit Identifier

Parameters:
  • unit_external_id (str) – External ID of the unit.

  • name (str) – Name of the unit.

class cognite.client.data_classes.units.UnitList(
resources: Sequence[T_CogniteResource],
)

Bases: CogniteResourceList[Unit], ExternalIDTransformerMixin

List of Units

class cognite.client.data_classes.units.UnitSystem(
name: str,
quantities: list[UnitID],
)

Bases: CogniteResource

This class represents a Unit System in CDF.

Parameters:
  • name (str) – The name of the unit system, e.g., SI and Imperial.

  • quantities (list[UnitID]) – The quantities of the unit system, e.g., length, mass, and so on.

dump(camel_case: bool = True) dict[str, Any]

Dump the instance into a json serializable Python data type.

Parameters:

camel_case (bool) – Use camelCase for attribute names. Defaults to True.

Returns:

A dictionary representation of the instance.

Return type:

dict[str, Any]

class cognite.client.data_classes.units.UnitSystemList(
resources: Sequence[T_CogniteResource],
)

Bases: CogniteResourceList[UnitSystem], NameTransformerMixin

List of Unit Systems