Skip to content

Units

albert.resources.units

UnitCategory

Bases: str, Enum

UnitCategory is an enumeration of possible unit categories.

Attributes:

Name Type Description
LENGTH str

Represents length units.

VOLUME str

Represents volume units.

LIQUID_VOLUME str

Represents liquid volume units.

ANGLES str

Represents angle units.

TIME str

Represents time units.

FREQUENCY str

Represents frequency units.

MASS str

Represents mass units.

CURRENT str

Represents electric current units.

TEMPERATURE str

Represents temperature units.

AMOUNT str

Represents amount of substance units.

LUMINOSITY str

Represents luminous intensity units.

FORCE str

Represents force units.

ENERGY str

Represents energy units.

POWER str

Represents power units.

PRESSURE str

Represents pressure units.

ELECTRICITY_AND_MAGNETISM str

Represents electricity and magnetism units.

OTHER str

Represents other units.

WEIGHT str

Represents weight units.

LENGTH

LENGTH = 'Length'

VOLUME

VOLUME = 'Volume'

LIQUID_VOLUME

LIQUID_VOLUME = 'Liquid volume'

ANGLES

ANGLES = 'Angles'

TIME

TIME = 'Time'

FREQUENCY

FREQUENCY = 'Frequency'

MASS

MASS = 'Mass'

CURRENT

CURRENT = 'Electric current'

TEMPERATURE

TEMPERATURE = 'Temperature'

AMOUNT

AMOUNT = 'Amount of substance'

LUMINOSITY

LUMINOSITY = 'Luminous intensity'

FORCE

FORCE = 'Force'

ENERGY

ENERGY = 'Energy'

POWER

POWER = 'Power'

PRESSURE

PRESSURE = 'Pressure'

ELECTRICITY_AND_MAGNETISM

ELECTRICITY_AND_MAGNETISM = 'Electricity and magnetism'

OTHER

OTHER = 'Other'

WEIGHT

WEIGHT = 'Weight'

AREA

AREA = 'Area'

SURFACE_AREA

SURFACE_AREA = 'Surface Area'

BINARY

BINARY = 'Binary'

CAPACITANCE

CAPACITANCE = 'Capacitance'

SPEED

SPEED = 'Speed'

ELECTRICAL_CONDUCTIVITY

ELECTRICAL_CONDUCTIVITY = 'Electrical conductivity'

ELECTRICAL_PERMITTIVITY

ELECTRICAL_PERMITTIVITY = 'Electrical permitivitty'

DENSITY

DENSITY = 'Density'

RESISTANCE

RESISTANCE = 'Resistance'

Unit

Bases: BaseResource

Unit is a Pydantic model representing a unit entity.

Attributes:

Name Type Description
id str | None

The Albert ID of the unit. Set when the unit is retrieved from Albert.

name str

The name of the unit.

symbol str | None

The symbol of the unit.

synonyms List[str] | None

The list of synonyms for the unit.

category UnitCategory

The category of the unit.

verified bool | None

Whether the unit is verified.

status Status | None

The status of the unit. Allowed values are active, and inactive

Show JSON schema:
{
  "$defs": {
    "AuditFields": {
      "description": "The audit fields for a resource",
      "properties": {
        "by": {
          "default": null,
          "title": "By",
          "type": "string"
        },
        "byName": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Byname"
        },
        "at": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "At"
        }
      },
      "title": "AuditFields",
      "type": "object"
    },
    "Status": {
      "description": "The status of a resource",
      "enum": [
        "active",
        "inactive"
      ],
      "title": "Status",
      "type": "string"
    },
    "UnitCategory": {
      "description": "UnitCategory is an enumeration of possible unit categories.\n\nAttributes\n----------\nLENGTH : str\n    Represents length units.\nVOLUME : str\n    Represents volume units.\nLIQUID_VOLUME : str\n    Represents liquid volume units.\nANGLES : str\n    Represents angle units.\nTIME : str\n    Represents time units.\nFREQUENCY : str\n    Represents frequency units.\nMASS : str\n    Represents mass units.\nCURRENT : str\n    Represents electric current units.\nTEMPERATURE : str\n    Represents temperature units.\nAMOUNT : str\n    Represents amount of substance units.\nLUMINOSITY : str\n    Represents luminous intensity units.\nFORCE : str\n    Represents force units.\nENERGY : str\n    Represents energy units.\nPOWER : str\n    Represents power units.\nPRESSURE : str\n    Represents pressure units.\nELECTRICITY_AND_MAGNETISM : str\n    Represents electricity and magnetism units.\nOTHER : str\n    Represents other units.\nWEIGHT : str\n    Represents weight units.",
      "enum": [
        "Length",
        "Volume",
        "Liquid volume",
        "Angles",
        "Time",
        "Frequency",
        "Mass",
        "Electric current",
        "Temperature",
        "Amount of substance",
        "Luminous intensity",
        "Force",
        "Energy",
        "Power",
        "Pressure",
        "Electricity and magnetism",
        "Other",
        "Weight",
        "Area",
        "Surface Area",
        "Binary",
        "Capacitance",
        "Speed",
        "Electrical conductivity",
        "Electrical permitivitty",
        "Density",
        "Resistance"
      ],
      "title": "UnitCategory",
      "type": "string"
    }
  },
  "description": "Unit is a Pydantic model representing a unit entity.\n\nAttributes\n----------\nid : str | None\n    The Albert ID of the unit. Set when the unit is retrieved from Albert.\nname : str\n    The name of the unit.\nsymbol : str | None\n    The symbol of the unit.\nsynonyms : List[str] | None\n    The list of synonyms for the unit.\ncategory : UnitCategory\n    The category of the unit.\nverified : bool | None\n    Whether the unit is verified.\nstatus : Status | None\n    The status of the unit. Allowed values are `active`, and `inactive`",
  "properties": {
    "status": {
      "anyOf": [
        {
          "$ref": "#/$defs/Status"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "Created": {
      "anyOf": [
        {
          "$ref": "#/$defs/AuditFields"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "Updated": {
      "anyOf": [
        {
          "$ref": "#/$defs/AuditFields"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "albertId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Albertid"
    },
    "name": {
      "title": "Name",
      "type": "string"
    },
    "symbol": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Symbol"
    },
    "Synonyms": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Synonyms"
    },
    "category": {
      "anyOf": [
        {
          "$ref": "#/$defs/UnitCategory"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "verified": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": false,
      "title": "Verified"
    }
  },
  "required": [
    "name"
  ],
  "title": "Unit",
  "type": "object"
}

Fields:

id

id: str | None = None

name

name: str

symbol

symbol: str | None = None

synonyms

synonyms: list[str] | None

category

category: UnitCategory | None = None

verified

verified: bool | None = False