Skip to content

Targets (🧪Beta)

albert.resources.targets

TargetType

Bases: str, Enum

Enumeration of target types.

Attributes:

Name Type Description
PERFORMANCE str

A performance target.

PERFORMANCE

PERFORMANCE = 'performance'

TargetOperator

Bases: str, Enum

Enumeration of target value comparison operators.

Attributes:

Name Type Description
EQ str

Equal to.

GTE str

Greater than or equal to.

LTE str

Less than or equal to.

BETWEEN str

Between a range.

IN_SET str

In a set of values.

EQ

EQ = 'eq'

GT

GT = 'gt'

GTE

GTE = 'gte'

LT

LT = 'lt'

LTE

LTE = 'lte'

BETWEEN

BETWEEN = 'between'

IN_SET

IN_SET = 'in-set'

TargetParameter

Bases: BaseAlbertModel

Represents a parameter value at which a target is measured.

Attributes:

Name Type Description
id str

The parameter ID.

parameter_group_id str | None

The parameter group ID.

category ParameterCategory

The parameter category.

unit_id str | None

The unit ID for this parameter.

value str | float | None

The parameter value.

sequence str

The parameter sequence.

Show JSON schema:
{
  "$defs": {
    "ParameterCategory": {
      "description": "The category of a parameter",
      "enum": [
        "Normal",
        "Special"
      ],
      "title": "ParameterCategory",
      "type": "string"
    }
  },
  "description": "Represents a parameter value at which a target is measured.\n\nAttributes\n----------\nid : str\n    The parameter ID.\nparameter_group_id : str | None\n    The parameter group ID.\ncategory : ParameterCategory\n    The parameter category.\nunit_id : str | None\n    The unit ID for this parameter.\nvalue : str | float | None\n    The parameter value.\nsequence : str\n    The parameter sequence.",
  "properties": {
    "id": {
      "title": "Id",
      "type": "string"
    },
    "parameterGroupId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Parametergroupid"
    },
    "category": {
      "$ref": "#/$defs/ParameterCategory"
    },
    "unitId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Unitid"
    },
    "value": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Value"
    },
    "sequence": {
      "title": "Sequence",
      "type": "string"
    }
  },
  "required": [
    "id",
    "category",
    "sequence"
  ],
  "title": "TargetParameter",
  "type": "object"
}

Fields:

id

parameter_group_id

parameter_group_id: ParameterGroupId | None = None

category

unit_id

unit_id: UnitId | None = None

value

value: str | float | None = None

sequence

sequence: str

TargetRangeValue

Bases: BaseAlbertModel

Represents a range value for a target (used with the 'between' operator).

Attributes:

Name Type Description
min float

The minimum value.

max float

The maximum value.

Show JSON schema:
{
  "description": "Represents a range value for a target (used with the 'between' operator).\n\nAttributes\n----------\nmin : float\n    The minimum value.\nmax : float\n    The maximum value.",
  "properties": {
    "min": {
      "title": "Min",
      "type": "number"
    },
    "max": {
      "title": "Max",
      "type": "number"
    }
  },
  "required": [
    "min",
    "max"
  ],
  "title": "TargetRangeValue",
  "type": "object"
}

Fields:

min

min: float

max

max: float

TargetValue

Bases: BaseAlbertModel

Represents the target value constraint.

Attributes:

Name Type Description
operator TargetOperator

The comparison operator.

value TargetRangeValue | str | float | list

The target value. Can be a range, single value, or list of values.

Show JSON schema:
{
  "$defs": {
    "TargetOperator": {
      "description": "Enumeration of target value comparison operators.\n\nAttributes\n----------\nEQ : str\n    Equal to.\nGTE : str\n    Greater than or equal to.\nLTE : str\n    Less than or equal to.\nBETWEEN : str\n    Between a range.\nIN_SET : str\n    In a set of values.",
      "enum": [
        "eq",
        "gt",
        "gte",
        "lt",
        "lte",
        "between",
        "in-set"
      ],
      "title": "TargetOperator",
      "type": "string"
    },
    "TargetRangeValue": {
      "description": "Represents a range value for a target (used with the 'between' operator).\n\nAttributes\n----------\nmin : float\n    The minimum value.\nmax : float\n    The maximum value.",
      "properties": {
        "min": {
          "title": "Min",
          "type": "number"
        },
        "max": {
          "title": "Max",
          "type": "number"
        }
      },
      "required": [
        "min",
        "max"
      ],
      "title": "TargetRangeValue",
      "type": "object"
    }
  },
  "description": "Represents the target value constraint.\n\nAttributes\n----------\noperator : TargetOperator\n    The comparison operator.\nvalue : TargetRangeValue | str | float | list\n    The target value. Can be a range, single value, or list of values.",
  "properties": {
    "operator": {
      "$ref": "#/$defs/TargetOperator"
    },
    "value": {
      "anyOf": [
        {
          "$ref": "#/$defs/TargetRangeValue"
        },
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "items": {},
          "type": "array"
        }
      ],
      "title": "Value"
    }
  },
  "required": [
    "operator",
    "value"
  ],
  "title": "TargetValue",
  "type": "object"
}

Fields:

operator

operator: TargetOperator

value

Target

Bases: BaseResource

Represents a target entity.

Attributes:

Name Type Description
id str | None

The unique identifier of the target. Set when retrieved from Albert.

name str

The name of the target.

type TargetType

The type of target.

data_template_id str

The ID of the associated data template.

data_column_id str

The ID of the associated data column.

unit_id str | None

The unit ID for this target.

parameters list[TargetParameter] | None

Parameter mappings for the target.

validation list[dict] | None

Validation rules for the target value.

target_value TargetValue

The target value constraint.

is_required bool

Whether this target is required.

validation list[dict] | None

Validation rules for the target.

id

id: str | None = Field(default=None)

name

name: str

type

type: TargetType

data_template_id

data_template_id: DataTemplateId = Field(
    alias="dataTemplateId"
)

data_column_id

data_column_id: DataColumnId = Field(alias='dataColumnId')

unit_id

unit_id: UnitId | None = Field(default=None, alias="unitId")

parameters

parameters: list[TargetParameter] | None = Field(
    default=None
)

target_value

target_value: TargetValue = Field(alias='targetValue')

is_required

is_required: bool = Field(alias='isRequired')

validation

validation: list[dict] | None = Field(default=None)