Attributes
albert.resources.attributes
AttributeCategory
AttributeScope
Scope for reading or deleting reference values on a parent entity.
Used with get_values,
delete_values,
and clear_values.
Inventory-level values are the source of truth for worksheet lookups; lot-level
values support lot-specific overrides where enabled.
SELF: only the given parent_id.
LOT: lots under an inventory parent_id (inventory parents only).
ALL: the parent and all of its child lots.
Attributes:
| Name | Type | Description |
|---|---|---|
SELF |
|
|
LOT |
|
|
ALL |
|
ValidationItem
Bases: BaseAlbertModel
Typed validation rule for an attribute definition.
Declares the allowed datatype (number, string, or enum) and optional
constraints. Numeric attributes may include min/max and an operator; enum
attributes list allowed options in value. Values assigned via
add_values
must conform to these rules.
Show JSON schema:
{
"$defs": {
"DataType": {
"description": "The data type of a parameter value, driving how it is validated.\n\nUsed by [`ValueValidation`][albert.resources.parameter_groups.ValueValidation] to declare what kind of value a parameter\naccepts.\n\nAttributes\n----------\nNUMBER : str\n A numeric value.\nSTRING : str\n A free-text string value.\nENUM : str\n A value restricted to a fixed set of options (see\n [`EnumValidationValue`][albert.resources.parameter_groups.EnumValidationValue]).\nIMAGE : str\n An image value.\nCURVE : str\n A curve (series) value.\nDATE : str\n A calendar date value stored as ``YYYY-MM-DD``.\nTIMESTAMP : str\n A date-and-time value in ISO 8601 format with a UTC offset\n (e.g. ``2026-05-21T14:32:00+02:00``).",
"enum": [
"number",
"string",
"enum",
"image",
"curve",
"date",
"timestamp"
],
"title": "DataType",
"type": "string"
},
"EnumValidationValue": {
"description": "Represents a value for an enum type validation.",
"properties": {
"text": {
"description": "The text of the enum value.",
"title": "Text",
"type": "string"
},
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the enum value. If not provided, the ID will be generated upon creation.",
"title": "Id"
},
"originalText": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Originaltext"
}
},
"required": [
"text"
],
"title": "EnumValidationValue",
"type": "object"
},
"Operator": {
"description": "A comparison operator constraining a numeric parameter value.\n\nUsed by [`ValueValidation`][albert.resources.parameter_groups.ValueValidation] to bound acceptable values. ``between``\ntakes ``min`` and ``max``; every single-bound operator takes ``value`` (e.g. ``gte``\nwith ``value=\"0\"`` requires the value to be at least 0).\n\nAttributes\n----------\nBETWEEN : str\n Value must fall between ``min`` and ``max`` (inclusive).\nLESS_THAN : str\n Value must be less than ``value``.\nLESS_THAN_OR_EQUAL : str\n Value must be less than or equal to ``value``.\nGREATER_THAN_OR_EQUAL : str\n Value must be greater than or equal to ``value``.\nGREATER_THAN : str\n Value must be greater than ``value``.\nEQUALS : str\n Value must equal ``value``.\nNOT_EQUALS : str\n Not accepted by the API for parameter validations.",
"enum": [
"between",
"lt",
"lte",
"gte",
"gt",
"eq",
"neq"
],
"title": "Operator",
"type": "string"
}
},
"description": "Typed validation rule for an attribute definition.\n\nDeclares the allowed datatype (`number`, `string`, or `enum`) and optional\nconstraints. Numeric attributes may include min/max and an operator; enum\nattributes list allowed options in ``value``. Values assigned via\n[`add_values`][albert.collections.attributes.AttributeCollection.add_values]\nmust conform to these rules.",
"properties": {
"datatype": {
"anyOf": [
{
"$ref": "#/$defs/DataType"
},
{
"type": "null"
}
],
"default": null,
"description": "Allowed value type: ``number``, ``string``, or ``enum``."
},
"min": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Minimum allowed numeric value (with ``between`` or range operators).",
"title": "Min"
},
"max": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Maximum allowed numeric value (with ``between`` or range operators).",
"title": "Max"
},
"value": {
"anyOf": [
{
"type": "number"
},
{
"items": {
"$ref": "#/$defs/EnumValidationValue"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Enum allowed options, or a scalar constraint depending on ``datatype``.",
"title": "Value"
},
"operator": {
"anyOf": [
{
"$ref": "#/$defs/Operator"
},
{
"type": "null"
}
],
"default": null,
"description": "Comparison operator for numeric validation (e.g. ``between``)."
}
},
"title": "ValidationItem",
"type": "object"
}
Fields:
-
datatype(DataType | None) -
min(float | None) -
max(float | None) -
value(float | list[EnumValidationValue] | None) -
operator(Operator | None)
Validators:
value
value: float | list[EnumValidationValue] | None = None
Enum allowed options, or a scalar constraint depending on datatype.
operator
operator: Operator | None = None
Comparison operator for numeric validation (e.g. between).
normalize_datatype
AttributeParameterItem
Bases: BaseAlbertModel
A parameter setpoint embedded in an attribute definition.
Parameter setpoints distinguish otherwise similar properties (e.g. Temperature = 25°C for "Viscosity @ 25°C"). Together with the data column and unit, they form the uniqueness key for an attribute definition.
Show JSON schema:
{
"$defs": {
"EntityLinkWithName": {
"description": "EntityLink that includes the name field in serialization.",
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"category": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Category"
}
},
"required": [
"id"
],
"title": "EntityLinkWithName",
"type": "object"
}
},
"description": "A parameter setpoint embedded in an attribute definition.\n\nParameter setpoints distinguish otherwise similar properties (e.g.\nTemperature = 25\u00b0C for \"Viscosity @ 25\u00b0C\"). Together with the data column\nand unit, they form the uniqueness key for an attribute definition.",
"properties": {
"id": {
"description": "Parameter ID.",
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Parameter display name.",
"title": "Name"
},
"category": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Parameter category.",
"title": "Category"
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "Setpoint value for this parameter.",
"title": "Value"
},
"unit": {
"anyOf": [
{
"$ref": "#/$defs/EntityLinkWithName"
},
{
"type": "null"
}
],
"default": null,
"description": "Unit for the setpoint, when applicable."
},
"unitId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Unit ID for the setpoint.",
"title": "Unitid"
}
},
"required": [
"id"
],
"title": "AttributeParameterItem",
"type": "object"
}
Fields:
-
id(ParameterId) -
name(str | None) -
category(str | None) -
value(str | dict | None) -
unit(EntityLinkWithName | None) -
unit_id(UnitId | None)
ExpressionType
Kind of worksheet calculation a FormulaMetadata defines.
INGREDIENT_BASIS: one value per ingredient, shown next to each ingredient's amount.
CALCULATED_PROPERTY: one value per formula, shown in a calculated property row.
Attributes:
| Name | Type | Description |
|---|---|---|
INGREDIENT_BASIS |
|
|
CALCULATED_PROPERTY |
|
FormulaMetadata
Bases: BaseAlbertModel
A worksheet calculation on an attribute: an ingredient basis or a calculated property.
An ingredient basis computes one value per ingredient (e.g. each ingredient's
share of total solids) and is the only kind that supports back-solving: with
request_inverse=True, editing a basis value on the sheet recalculates that
ingredient's amount. A calculated property computes one value per formula
(e.g. total solids or density) and cannot be back-solved. An attribute can hold
several ingredient bases and several calculated properties. A sheet uses one
ingredient basis per attribute. Every calculated property shows on the sheet, but
only the attribute's first one, in sheet order, is saved to the formula's inventory
and published as the attribute's value, so give a variant that must be saved its own
attribute. To see which ones a sheet shows, use
get_calculations.
Expression variables:
wt%: the ingredient's weight percent, currently a whole number (40 means 40%). Ratios such aswt% / sum(wt%)give the same result on any scale.parts_mass: the ingredient's amount.[ATR123]: the ingredient's value for another attribute, always by attribute ID. A name such as[Solid %]reads as 0. Resolve names to IDs withsearch.ingredient_basis: the ingredient's value from this attribute's ingredient basis. Calculated properties only, and the attribute must also have an ingredient basis.Function: the ingredient's value in the sheet's Function column, only insideWHERE. Values are the tenant's inventory function names; list them withget_allandlist_type="inventoryFunction". A value no ingredient has matches nothing and gives a blank result.
Combine them with + - * /, parentheses and numbers, and aggregate with:
sum(x): total over all ingredients.sum(x WHERE Function = "Core"): total over matching ingredients.WHEREworks only insidesum(...), values are quoted, and several values of one key combine withOR(Function = "Core" OR Function = "Shell");ANDand mixed keys are not supported. A text attribute can filter instead ofFunction([ATR123] = "Epoxy").harmonicMean(weight, [ATR123]): weighted harmonic mean (e.g. density).
Typical expressions:
- Weighted average (calculated property):
sum(wt% * [ATR45]) / sum(wt%). - Share per ingredient (ingredient basis):
wt% / sum(wt%) * [ATR45], totalled by a calculated propertysum(ingredient_basis). - Parts per hundred resin (ingredient basis):
wt% / sum(wt% WHERE Function = "Resin") * 100. - Density (calculated property):
harmonicMean(wt%, [ATR67]). - Ratio (calculated property):
sum(wt% WHERE Function = "Core") / sum(wt% WHERE Function = "Shell").
Expressions are not checked when saved: a name instead of an ID, an ID that does
not exist, or a malformed WHERE saves without error and shows blank values, 0
or an error on the sheet. Double-check every [ATR...] ID.
Saving a formula on the attribute does not change any sheet. Add it to a sheet with
add_calculation or the
worksheet's Manage Worksheet option: a calculated property then shows as a row
named after its display_name in the sheet's Calculated Properties section, and
an ingredient basis as a column under each formulation column.
Values are computed on the worksheet, not when the formula is saved. To estimate a
value for another composition, evaluate the expression over the sheet's ingredient
values: an ingredient missing a referenced value has a blank basis (not 0) and is
left out of a calculated property, a WHERE that matches nothing gives a blank
result, and division by zero is an error. A saved calculated property value is
also published as the attribute's value on the formula, so the attribute's
validation (e.g. a 0 to 100 range) must allow it; otherwise it shows on the sheet
but is not published.
Fields also accept their camelCase names (displayName, expressionType,
requestInverse), which are the names the schema shows.
Show JSON schema:
{
"$defs": {
"ExpressionType": {
"description": "Kind of worksheet calculation a [`FormulaMetadata`][albert.resources.attributes.FormulaMetadata] defines.\n\n``INGREDIENT_BASIS``: one value per ingredient, shown next to each ingredient's amount.\n``CALCULATED_PROPERTY``: one value per formula, shown in a calculated property row.",
"enum": [
"INGREDIENT_BASIS",
"CALCULATED_PROPERTY"
],
"title": "ExpressionType",
"type": "string"
}
},
"additionalProperties": true,
"description": "A worksheet calculation on an attribute: an ingredient basis or a calculated property.\n\nAn *ingredient basis* computes one value per ingredient (e.g. each ingredient's\nshare of total solids) and is the only kind that supports back-solving: with\n``request_inverse=True``, editing a basis value on the sheet recalculates that\ningredient's amount. A *calculated property* computes one value per formula\n(e.g. total solids or density) and cannot be back-solved. An attribute can hold\nseveral ingredient bases and several calculated properties. A sheet uses one\ningredient basis per attribute. Every calculated property shows on the sheet, but\nonly the attribute's first one, in sheet order, is saved to the formula's inventory\nand published as the attribute's value, so give a variant that must be saved its own\nattribute. To see which ones a sheet shows, use\n[`get_calculations`][albert.resources.sheets.Sheet.get_calculations].\n\nExpression variables:\n\n- ``wt%``: the ingredient's weight percent, currently a whole number (40 means\n 40%). Ratios such as ``wt% / sum(wt%)`` give the same result on any scale.\n- ``parts_mass``: the ingredient's amount.\n- ``[ATR123]``: the ingredient's value for another attribute, always by attribute\n ID. A name such as ``[Solid %]`` reads as 0. Resolve names to IDs with\n [`search`][albert.collections.attributes.AttributeCollection.search].\n- ``ingredient_basis``: the ingredient's value from this attribute's ingredient\n basis. Calculated properties only, and the attribute must also have an\n ingredient basis.\n- ``Function``: the ingredient's value in the sheet's Function column, only inside\n ``WHERE``. Values are the tenant's inventory function names; list them with\n [`get_all`][albert.collections.lists.ListsCollection.get_all] and\n ``list_type=\"inventoryFunction\"``. A value no ingredient has matches nothing and\n gives a blank result.\n\nCombine them with ``+ - * /``, parentheses and numbers, and aggregate with:\n\n- ``sum(x)``: total over all ingredients.\n- ``sum(x WHERE Function = \"Core\")``: total over matching ingredients. ``WHERE``\n works only inside ``sum(...)``, values are quoted, and several values of one key\n combine with ``OR`` (``Function = \"Core\" OR Function = \"Shell\"``); ``AND`` and\n mixed keys are not supported. A text attribute can filter instead of\n ``Function`` (``[ATR123] = \"Epoxy\"``).\n- ``harmonicMean(weight, [ATR123])``: weighted harmonic mean (e.g. density).\n\nTypical expressions:\n\n- Weighted average (calculated property): ``sum(wt% * [ATR45]) / sum(wt%)``.\n- Share per ingredient (ingredient basis): ``wt% / sum(wt%) * [ATR45]``, totalled by\n a calculated property ``sum(ingredient_basis)``.\n- Parts per hundred resin (ingredient basis):\n ``wt% / sum(wt% WHERE Function = \"Resin\") * 100``.\n- Density (calculated property): ``harmonicMean(wt%, [ATR67])``.\n- Ratio (calculated property):\n ``sum(wt% WHERE Function = \"Core\") / sum(wt% WHERE Function = \"Shell\")``.\n\nExpressions are not checked when saved: a name instead of an ID, an ID that does\nnot exist, or a malformed ``WHERE`` saves without error and shows blank values, 0\nor an error on the sheet. Double-check every ``[ATR...]`` ID.\n\nSaving a formula on the attribute does not change any sheet. Add it to a sheet with\n[`add_calculation`][albert.resources.sheets.Sheet.add_calculation] or the\nworksheet's Manage Worksheet option: a calculated property then shows as a row\nnamed after its ``display_name`` in the sheet's Calculated Properties section, and\nan ingredient basis as a column under each formulation column.\n\nValues are computed on the worksheet, not when the formula is saved. To estimate a\nvalue for another composition, evaluate the expression over the sheet's ingredient\nvalues: an ingredient missing a referenced value has a blank basis (not 0) and is\nleft out of a calculated property, a ``WHERE`` that matches nothing gives a blank\nresult, and division by zero is an error. A saved calculated property value is\nalso published as the attribute's value on the formula, so the attribute's\nvalidation (e.g. a 0 to 100 range) must allow it; otherwise it shows on the sheet\nbut is not published.\n\nFields also accept their camelCase names (``displayName``, ``expressionType``,\n``requestInverse``), which are the names the schema shows.",
"properties": {
"displayName": {
"description": "Name shown on the worksheet. Unique within the attribute.",
"title": "Displayname",
"type": "string"
},
"expression": {
"description": "Formula text, e.g. ``sum(wt% * [ATR45]) / sum(wt%)``. Reference attributes by ID, never by name.",
"title": "Expression",
"type": "string"
},
"expressionType": {
"anyOf": [
{
"$ref": "#/$defs/ExpressionType"
},
{
"type": "string"
}
],
"description": "``INGREDIENT_BASIS`` (one value per ingredient) or ``CALCULATED_PROPERTY`` (one value per formula). Unknown values parse as plain strings.",
"title": "Expressiontype"
},
"requestInverse": {
"description": "Allow back-solving an ingredient's amount from an edited basis value. Must be ``False`` on a calculated property.",
"title": "Requestinverse",
"type": "boolean"
}
},
"required": [
"displayName",
"expression",
"expressionType",
"requestInverse"
],
"title": "FormulaMetadata",
"type": "object"
}
Config:
extra:allow
Fields:
expression
expression: str
Formula text, e.g. sum(wt% * [ATR45]) / sum(wt%). Reference attributes by ID, never by name.
expression_type
expression_type: ExpressionType | str
INGREDIENT_BASIS (one value per ingredient) or CALCULATED_PROPERTY (one value per formula). Unknown values parse as plain strings.
request_inverse
request_inverse: bool
Allow back-solving an ingredient's amount from an edited basis value. Must be False on a calculated property.
Attribute
Bases: BaseResource
An inventory reference attribute definition.
Defines a reusable property template (e.g. "Viscosity @ 25°C") that can be
assigned to many inventory items and lots. Each definition links a
DataColumn, optional parameter
setpoints, an optional unit, and typed validation. This is separate from a
reference value: the per-parent measurement stored with
add_values.
Replaces inline property definitions from the deprecated Inventory Specs API.
Attributes are identified by Attribute ID (format ATR...).
Show JSON schema:
{
"$defs": {
"AttributeCategory": {
"description": "Category of an inventory reference attribute.\n\n``Property``: inventory reference properties tied to a data column (e.g.\nviscosity, pH) for use in worksheets and inventory details.",
"enum": [
"Property"
],
"title": "AttributeCategory",
"type": "string"
},
"AttributeParameterItem": {
"description": "A parameter setpoint embedded in an attribute definition.\n\nParameter setpoints distinguish otherwise similar properties (e.g.\nTemperature = 25\u00b0C for \"Viscosity @ 25\u00b0C\"). Together with the data column\nand unit, they form the uniqueness key for an attribute definition.",
"properties": {
"id": {
"description": "Parameter ID.",
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Parameter display name.",
"title": "Name"
},
"category": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Parameter category.",
"title": "Category"
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "Setpoint value for this parameter.",
"title": "Value"
},
"unit": {
"anyOf": [
{
"$ref": "#/$defs/EntityLinkWithName"
},
{
"type": "null"
}
],
"default": null,
"description": "Unit for the setpoint, when applicable."
},
"unitId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Unit ID for the setpoint.",
"title": "Unitid"
}
},
"required": [
"id"
],
"title": "AttributeParameterItem",
"type": "object"
},
"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"
},
"DataType": {
"description": "The data type of a parameter value, driving how it is validated.\n\nUsed by [`ValueValidation`][albert.resources.parameter_groups.ValueValidation] to declare what kind of value a parameter\naccepts.\n\nAttributes\n----------\nNUMBER : str\n A numeric value.\nSTRING : str\n A free-text string value.\nENUM : str\n A value restricted to a fixed set of options (see\n [`EnumValidationValue`][albert.resources.parameter_groups.EnumValidationValue]).\nIMAGE : str\n An image value.\nCURVE : str\n A curve (series) value.\nDATE : str\n A calendar date value stored as ``YYYY-MM-DD``.\nTIMESTAMP : str\n A date-and-time value in ISO 8601 format with a UTC offset\n (e.g. ``2026-05-21T14:32:00+02:00``).",
"enum": [
"number",
"string",
"enum",
"image",
"curve",
"date",
"timestamp"
],
"title": "DataType",
"type": "string"
},
"EntityLink": {
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"category": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Category"
}
},
"required": [
"id"
],
"title": "EntityLink",
"type": "object"
},
"EntityLinkWithName": {
"description": "EntityLink that includes the name field in serialization.",
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"category": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Category"
}
},
"required": [
"id"
],
"title": "EntityLinkWithName",
"type": "object"
},
"EnumValidationValue": {
"description": "Represents a value for an enum type validation.",
"properties": {
"text": {
"description": "The text of the enum value.",
"title": "Text",
"type": "string"
},
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the enum value. If not provided, the ID will be generated upon creation.",
"title": "Id"
},
"originalText": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Originaltext"
}
},
"required": [
"text"
],
"title": "EnumValidationValue",
"type": "object"
},
"ExpressionType": {
"description": "Kind of worksheet calculation a [`FormulaMetadata`][albert.resources.attributes.FormulaMetadata] defines.\n\n``INGREDIENT_BASIS``: one value per ingredient, shown next to each ingredient's amount.\n``CALCULATED_PROPERTY``: one value per formula, shown in a calculated property row.",
"enum": [
"INGREDIENT_BASIS",
"CALCULATED_PROPERTY"
],
"title": "ExpressionType",
"type": "string"
},
"FormulaMetadata": {
"additionalProperties": true,
"description": "A worksheet calculation on an attribute: an ingredient basis or a calculated property.\n\nAn *ingredient basis* computes one value per ingredient (e.g. each ingredient's\nshare of total solids) and is the only kind that supports back-solving: with\n``request_inverse=True``, editing a basis value on the sheet recalculates that\ningredient's amount. A *calculated property* computes one value per formula\n(e.g. total solids or density) and cannot be back-solved. An attribute can hold\nseveral ingredient bases and several calculated properties. A sheet uses one\ningredient basis per attribute. Every calculated property shows on the sheet, but\nonly the attribute's first one, in sheet order, is saved to the formula's inventory\nand published as the attribute's value, so give a variant that must be saved its own\nattribute. To see which ones a sheet shows, use\n[`get_calculations`][albert.resources.sheets.Sheet.get_calculations].\n\nExpression variables:\n\n- ``wt%``: the ingredient's weight percent, currently a whole number (40 means\n 40%). Ratios such as ``wt% / sum(wt%)`` give the same result on any scale.\n- ``parts_mass``: the ingredient's amount.\n- ``[ATR123]``: the ingredient's value for another attribute, always by attribute\n ID. A name such as ``[Solid %]`` reads as 0. Resolve names to IDs with\n [`search`][albert.collections.attributes.AttributeCollection.search].\n- ``ingredient_basis``: the ingredient's value from this attribute's ingredient\n basis. Calculated properties only, and the attribute must also have an\n ingredient basis.\n- ``Function``: the ingredient's value in the sheet's Function column, only inside\n ``WHERE``. Values are the tenant's inventory function names; list them with\n [`get_all`][albert.collections.lists.ListsCollection.get_all] and\n ``list_type=\"inventoryFunction\"``. A value no ingredient has matches nothing and\n gives a blank result.\n\nCombine them with ``+ - * /``, parentheses and numbers, and aggregate with:\n\n- ``sum(x)``: total over all ingredients.\n- ``sum(x WHERE Function = \"Core\")``: total over matching ingredients. ``WHERE``\n works only inside ``sum(...)``, values are quoted, and several values of one key\n combine with ``OR`` (``Function = \"Core\" OR Function = \"Shell\"``); ``AND`` and\n mixed keys are not supported. A text attribute can filter instead of\n ``Function`` (``[ATR123] = \"Epoxy\"``).\n- ``harmonicMean(weight, [ATR123])``: weighted harmonic mean (e.g. density).\n\nTypical expressions:\n\n- Weighted average (calculated property): ``sum(wt% * [ATR45]) / sum(wt%)``.\n- Share per ingredient (ingredient basis): ``wt% / sum(wt%) * [ATR45]``, totalled by\n a calculated property ``sum(ingredient_basis)``.\n- Parts per hundred resin (ingredient basis):\n ``wt% / sum(wt% WHERE Function = \"Resin\") * 100``.\n- Density (calculated property): ``harmonicMean(wt%, [ATR67])``.\n- Ratio (calculated property):\n ``sum(wt% WHERE Function = \"Core\") / sum(wt% WHERE Function = \"Shell\")``.\n\nExpressions are not checked when saved: a name instead of an ID, an ID that does\nnot exist, or a malformed ``WHERE`` saves without error and shows blank values, 0\nor an error on the sheet. Double-check every ``[ATR...]`` ID.\n\nSaving a formula on the attribute does not change any sheet. Add it to a sheet with\n[`add_calculation`][albert.resources.sheets.Sheet.add_calculation] or the\nworksheet's Manage Worksheet option: a calculated property then shows as a row\nnamed after its ``display_name`` in the sheet's Calculated Properties section, and\nan ingredient basis as a column under each formulation column.\n\nValues are computed on the worksheet, not when the formula is saved. To estimate a\nvalue for another composition, evaluate the expression over the sheet's ingredient\nvalues: an ingredient missing a referenced value has a blank basis (not 0) and is\nleft out of a calculated property, a ``WHERE`` that matches nothing gives a blank\nresult, and division by zero is an error. A saved calculated property value is\nalso published as the attribute's value on the formula, so the attribute's\nvalidation (e.g. a 0 to 100 range) must allow it; otherwise it shows on the sheet\nbut is not published.\n\nFields also accept their camelCase names (``displayName``, ``expressionType``,\n``requestInverse``), which are the names the schema shows.",
"properties": {
"displayName": {
"description": "Name shown on the worksheet. Unique within the attribute.",
"title": "Displayname",
"type": "string"
},
"expression": {
"description": "Formula text, e.g. ``sum(wt% * [ATR45]) / sum(wt%)``. Reference attributes by ID, never by name.",
"title": "Expression",
"type": "string"
},
"expressionType": {
"anyOf": [
{
"$ref": "#/$defs/ExpressionType"
},
{
"type": "string"
}
],
"description": "``INGREDIENT_BASIS`` (one value per ingredient) or ``CALCULATED_PROPERTY`` (one value per formula). Unknown values parse as plain strings.",
"title": "Expressiontype"
},
"requestInverse": {
"description": "Allow back-solving an ingredient's amount from an edited basis value. Must be ``False`` on a calculated property.",
"title": "Requestinverse",
"type": "boolean"
}
},
"required": [
"displayName",
"expression",
"expressionType",
"requestInverse"
],
"title": "FormulaMetadata",
"type": "object"
},
"Operator": {
"description": "A comparison operator constraining a numeric parameter value.\n\nUsed by [`ValueValidation`][albert.resources.parameter_groups.ValueValidation] to bound acceptable values. ``between``\ntakes ``min`` and ``max``; every single-bound operator takes ``value`` (e.g. ``gte``\nwith ``value=\"0\"`` requires the value to be at least 0).\n\nAttributes\n----------\nBETWEEN : str\n Value must fall between ``min`` and ``max`` (inclusive).\nLESS_THAN : str\n Value must be less than ``value``.\nLESS_THAN_OR_EQUAL : str\n Value must be less than or equal to ``value``.\nGREATER_THAN_OR_EQUAL : str\n Value must be greater than or equal to ``value``.\nGREATER_THAN : str\n Value must be greater than ``value``.\nEQUALS : str\n Value must equal ``value``.\nNOT_EQUALS : str\n Not accepted by the API for parameter validations.",
"enum": [
"between",
"lt",
"lte",
"gte",
"gt",
"eq",
"neq"
],
"title": "Operator",
"type": "string"
},
"Status": {
"description": "The status of a resource.\n\nAttributes\n----------\nACTIVE : str\n The resource is fully operational and visible in normal operations.\nINACTIVE : str\n The resource is hidden from normal operations and disabled from use.",
"enum": [
"active",
"inactive"
],
"title": "Status",
"type": "string"
},
"ValidationItem": {
"description": "Typed validation rule for an attribute definition.\n\nDeclares the allowed datatype (`number`, `string`, or `enum`) and optional\nconstraints. Numeric attributes may include min/max and an operator; enum\nattributes list allowed options in ``value``. Values assigned via\n[`add_values`][albert.collections.attributes.AttributeCollection.add_values]\nmust conform to these rules.",
"properties": {
"datatype": {
"anyOf": [
{
"$ref": "#/$defs/DataType"
},
{
"type": "null"
}
],
"default": null,
"description": "Allowed value type: ``number``, ``string``, or ``enum``."
},
"min": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Minimum allowed numeric value (with ``between`` or range operators).",
"title": "Min"
},
"max": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Maximum allowed numeric value (with ``between`` or range operators).",
"title": "Max"
},
"value": {
"anyOf": [
{
"type": "number"
},
{
"items": {
"$ref": "#/$defs/EnumValidationValue"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Enum allowed options, or a scalar constraint depending on ``datatype``.",
"title": "Value"
},
"operator": {
"anyOf": [
{
"$ref": "#/$defs/Operator"
},
{
"type": "null"
}
],
"default": null,
"description": "Comparison operator for numeric validation (e.g. ``between``)."
}
},
"title": "ValidationItem",
"type": "object"
}
},
"description": "An inventory reference attribute definition.\n\nDefines a reusable property template (e.g. \"Viscosity @ 25\u00b0C\") that can be\nassigned to many inventory items and lots. Each definition links a\n[`DataColumn`][albert.resources.data_columns.DataColumn], optional parameter\nsetpoints, an optional unit, and typed validation. This is separate from a\n*reference value*: the per-parent measurement stored with\n[`add_values`][albert.collections.attributes.AttributeCollection.add_values].\n\nReplaces inline property definitions from the deprecated Inventory Specs API.\nAttributes are identified by Attribute ID (format ``ATR...``).",
"properties": {
"status": {
"anyOf": [
{
"$ref": "#/$defs/Status"
},
{
"type": "null"
}
],
"default": null,
"description": "The status of the resource, optional."
},
"Created": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null,
"description": "Audit fields for the creation of the resource, optional."
},
"Updated": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null,
"description": "Audit fields for the update of the resource, optional."
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Attribute ID (format ``ATR...``).",
"title": "Albertid"
},
"referenceName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Unique display name. Default pattern: ``{DataColumn} | {parameter setpoints}``.",
"title": "Referencename"
},
"fullName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Localized full name for display.",
"title": "Fullname"
},
"nameOverride": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether ``reference_name`` was manually set instead of the default pattern.",
"title": "Nameoverride"
},
"datacolumn": {
"anyOf": [
{
"$ref": "#/$defs/EntityLinkWithName"
},
{
"type": "null"
}
],
"default": null,
"description": "Linked data column (the property being referenced, e.g. Viscosity)."
},
"datacolumnId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Data column ID when creating an attribute.",
"title": "Datacolumnid"
},
"unit": {
"anyOf": [
{
"$ref": "#/$defs/EntityLinkWithName"
},
{
"type": "null"
}
],
"default": null,
"description": "Unit for numeric reference values (e.g. cP). Immutable after first assignment."
},
"unitId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Unit ID when creating an attribute.",
"title": "Unitid"
},
"workflow": {
"anyOf": [
{
"$ref": "#/$defs/EntityLink"
},
{
"type": "null"
}
],
"default": null,
"description": "Workflow derived from parameter setpoints (order-agnostic)."
},
"validation": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/ValidationItem"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Datatype and constraints for values assigned to this attribute.",
"title": "Validation"
},
"category": {
"anyOf": [
{
"$ref": "#/$defs/AttributeCategory"
},
{
"type": "null"
}
],
"default": null,
"description": "Attribute category (currently ``Property`` for inventory references)."
},
"parameters": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/AttributeParameterItem"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Parameter setpoints that define measurement conditions for this attribute.",
"title": "Parameters"
},
"formulaMetadata": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/FormulaMetadata"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Ingredient basis and calculated property formulas for worksheets. Updates replace the whole list.",
"title": "Formulametadata"
}
},
"title": "Attribute",
"type": "object"
}
Fields:
-
status(Status | None) -
created(AuditFields | None) -
updated(AuditFields | None) -
id(AttributeId | None) -
reference_name(str | None) -
full_name(str | None) -
name_override(bool | None) -
datacolumn(EntityLinkWithName | None) -
datacolumn_id(DataColumnId | None) -
unit(EntityLinkWithName | None) -
unit_id(UnitId | None) -
workflow(EntityLink | None) -
validation(list[ValidationItem] | None) -
category(AttributeCategory | None) -
parameters(list[AttributeParameterItem] | None) -
formula_metadata(list[FormulaMetadata] | None)
Validators:
reference_name
reference_name: str | None = None
Unique display name. Default pattern: {DataColumn} | {parameter setpoints}.
name_override
name_override: bool | None = None
Whether reference_name was manually set instead of the default pattern.
datacolumn
datacolumn: EntityLinkWithName | None = None
Linked data column (the property being referenced, e.g. Viscosity).
unit
unit: EntityLinkWithName | None = None
Unit for numeric reference values (e.g. cP). Immutable after first assignment.
workflow
workflow: EntityLink | None = None
Workflow derived from parameter setpoints (order-agnostic).
validation
validation: list[ValidationItem] | None = None
Datatype and constraints for values assigned to this attribute.
category
category: AttributeCategory | None = None
Attribute category (currently Property for inventory references).
parameters
parameters: list[AttributeParameterItem] | None = None
Parameter setpoints that define measurement conditions for this attribute.
formula_metadata
formula_metadata: list[FormulaMetadata] | None = None
Ingredient basis and calculated property formulas for worksheets. Updates replace the whole list.
AttributeSearchItem
Bases: BaseAlbertModel
A lightweight attribute hit from search.
Show JSON schema:
{
"description": "A lightweight attribute hit from [`search`][albert.collections.attributes.AttributeCollection.search].",
"properties": {
"albertId": {
"description": "Attribute ID (format ``ATR...``).",
"title": "Albertid",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Display name of the attribute.",
"title": "Name"
},
"datacolumnId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Linked data column ID.",
"title": "Datacolumnid"
},
"datacolumnName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Linked data column name.",
"title": "Datacolumnname"
},
"unitName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Unit name for numeric attributes.",
"title": "Unitname"
},
"parameters": {
"anyOf": [
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Summary of linked parameter setpoints.",
"title": "Parameters"
}
},
"required": [
"albertId"
],
"title": "AttributeSearchItem",
"type": "object"
}
Fields:
-
id(AttributeId) -
name(str | None) -
datacolumn_id(str | None) -
datacolumn_name(str | None) -
unit_name(str | None) -
parameters(list[dict] | None)
AttributeValueRange
Bases: BaseAlbertModel
Numeric min/max bounds for a reference value.
Used when an attribute allows a target value plus an acceptable range
(legacy Specs min/max semantics).
Show JSON schema:
{
"description": "Numeric min/max bounds for a reference value.\n\nUsed when an attribute allows a target value plus an acceptable range\n(legacy Specs ``min``/``max`` semantics).",
"properties": {
"min": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Minimum bound.",
"title": "Min"
},
"max": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Maximum bound.",
"title": "Max"
},
"comparisonOperator": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "How ``min`` and ``max`` constrain the value.",
"title": "Comparisonoperator"
}
},
"title": "AttributeValueRange",
"type": "object"
}
Fields:
AttributeValue
Bases: BaseAlbertModel
A reference value to assign on a parent entity for one attribute.
Pass to add_values.
The value must match the attribute datatype (numeric, enum option, or string).
Values belong only to the given parent_id (one inventory item or lot).
Show JSON schema:
{
"$defs": {
"AttributeValueRange": {
"description": "Numeric min/max bounds for a reference value.\n\nUsed when an attribute allows a target value plus an acceptable range\n(legacy Specs ``min``/``max`` semantics).",
"properties": {
"min": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Minimum bound.",
"title": "Min"
},
"max": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Maximum bound.",
"title": "Max"
},
"comparisonOperator": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "How ``min`` and ``max`` constrain the value.",
"title": "Comparisonoperator"
}
},
"title": "AttributeValueRange",
"type": "object"
}
},
"description": "A reference value to assign on a parent entity for one attribute.\n\nPass to [`add_values`][albert.collections.attributes.AttributeCollection.add_values].\nThe value must match the attribute datatype (numeric, enum option, or string).\nValues belong only to the given ``parent_id`` (one inventory item or lot).",
"properties": {
"attributeId": {
"description": "Attribute definition to set a value for.",
"title": "Attributeid",
"type": "string"
},
"referenceValue": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Assigned value (target for numeric types, selected option for enum).",
"title": "Referencevalue"
},
"range": {
"anyOf": [
{
"$ref": "#/$defs/AttributeValueRange"
},
{
"type": "null"
}
],
"default": null,
"description": "Optional numeric min/max bounds alongside ``reference_value``."
},
"lockedAtCreation": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether this value was locked when the parent entity was created and cannot be changed.",
"title": "Lockedatcreation"
}
},
"required": [
"attributeId"
],
"title": "AttributeValue",
"type": "object"
}
Fields:
-
attribute_id(AttributeId) -
reference_value(str | float | None) -
range(AttributeValueRange | None) -
locked_at_creation(bool | None)
reference_value
Assigned value (target for numeric types, selected option for enum).
range
range: AttributeValueRange | None = None
Optional numeric min/max bounds alongside reference_value.
locked_at_creation
locked_at_creation: bool | None = None
Whether this value was locked when the parent entity was created and cannot be changed.
AttributeDefinition
Bases: BaseAlbertModel
Read-only attribute metadata embedded in a values response.
Distinct from Attribute: uses name
(not referenceName) and reports prmCount instead of the full parameters list.
Show JSON schema:
{
"$defs": {
"AttributeCategory": {
"description": "Category of an inventory reference attribute.\n\n``Property``: inventory reference properties tied to a data column (e.g.\nviscosity, pH) for use in worksheets and inventory details.",
"enum": [
"Property"
],
"title": "AttributeCategory",
"type": "string"
},
"DataType": {
"description": "The data type of a parameter value, driving how it is validated.\n\nUsed by [`ValueValidation`][albert.resources.parameter_groups.ValueValidation] to declare what kind of value a parameter\naccepts.\n\nAttributes\n----------\nNUMBER : str\n A numeric value.\nSTRING : str\n A free-text string value.\nENUM : str\n A value restricted to a fixed set of options (see\n [`EnumValidationValue`][albert.resources.parameter_groups.EnumValidationValue]).\nIMAGE : str\n An image value.\nCURVE : str\n A curve (series) value.\nDATE : str\n A calendar date value stored as ``YYYY-MM-DD``.\nTIMESTAMP : str\n A date-and-time value in ISO 8601 format with a UTC offset\n (e.g. ``2026-05-21T14:32:00+02:00``).",
"enum": [
"number",
"string",
"enum",
"image",
"curve",
"date",
"timestamp"
],
"title": "DataType",
"type": "string"
},
"EntityLink": {
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"category": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Category"
}
},
"required": [
"id"
],
"title": "EntityLink",
"type": "object"
},
"EntityLinkWithName": {
"description": "EntityLink that includes the name field in serialization.",
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"category": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Category"
}
},
"required": [
"id"
],
"title": "EntityLinkWithName",
"type": "object"
},
"EnumValidationValue": {
"description": "Represents a value for an enum type validation.",
"properties": {
"text": {
"description": "The text of the enum value.",
"title": "Text",
"type": "string"
},
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the enum value. If not provided, the ID will be generated upon creation.",
"title": "Id"
},
"originalText": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Originaltext"
}
},
"required": [
"text"
],
"title": "EnumValidationValue",
"type": "object"
},
"Operator": {
"description": "A comparison operator constraining a numeric parameter value.\n\nUsed by [`ValueValidation`][albert.resources.parameter_groups.ValueValidation] to bound acceptable values. ``between``\ntakes ``min`` and ``max``; every single-bound operator takes ``value`` (e.g. ``gte``\nwith ``value=\"0\"`` requires the value to be at least 0).\n\nAttributes\n----------\nBETWEEN : str\n Value must fall between ``min`` and ``max`` (inclusive).\nLESS_THAN : str\n Value must be less than ``value``.\nLESS_THAN_OR_EQUAL : str\n Value must be less than or equal to ``value``.\nGREATER_THAN_OR_EQUAL : str\n Value must be greater than or equal to ``value``.\nGREATER_THAN : str\n Value must be greater than ``value``.\nEQUALS : str\n Value must equal ``value``.\nNOT_EQUALS : str\n Not accepted by the API for parameter validations.",
"enum": [
"between",
"lt",
"lte",
"gte",
"gt",
"eq",
"neq"
],
"title": "Operator",
"type": "string"
},
"ValidationItem": {
"description": "Typed validation rule for an attribute definition.\n\nDeclares the allowed datatype (`number`, `string`, or `enum`) and optional\nconstraints. Numeric attributes may include min/max and an operator; enum\nattributes list allowed options in ``value``. Values assigned via\n[`add_values`][albert.collections.attributes.AttributeCollection.add_values]\nmust conform to these rules.",
"properties": {
"datatype": {
"anyOf": [
{
"$ref": "#/$defs/DataType"
},
{
"type": "null"
}
],
"default": null,
"description": "Allowed value type: ``number``, ``string``, or ``enum``."
},
"min": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Minimum allowed numeric value (with ``between`` or range operators).",
"title": "Min"
},
"max": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Maximum allowed numeric value (with ``between`` or range operators).",
"title": "Max"
},
"value": {
"anyOf": [
{
"type": "number"
},
{
"items": {
"$ref": "#/$defs/EnumValidationValue"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Enum allowed options, or a scalar constraint depending on ``datatype``.",
"title": "Value"
},
"operator": {
"anyOf": [
{
"$ref": "#/$defs/Operator"
},
{
"type": "null"
}
],
"default": null,
"description": "Comparison operator for numeric validation (e.g. ``between``)."
}
},
"title": "ValidationItem",
"type": "object"
}
},
"description": "Read-only attribute metadata embedded in a values response.\n\nDistinct from [`Attribute`][albert.resources.attributes.Attribute]: uses ``name``\n(not ``referenceName``) and reports ``prmCount`` instead of the full parameters list.",
"properties": {
"name": {
"description": "Attribute display name.",
"title": "Name",
"type": "string"
},
"fullName": {
"description": "Localized full name.",
"title": "Fullname",
"type": "string"
},
"datacolumn": {
"$ref": "#/$defs/EntityLinkWithName",
"description": "Data column this reference measures."
},
"category": {
"$ref": "#/$defs/AttributeCategory",
"description": "Attribute category."
},
"unit": {
"anyOf": [
{
"$ref": "#/$defs/EntityLinkWithName"
},
{
"type": "null"
}
],
"default": null,
"description": "Unit for numeric values."
},
"workflow": {
"$ref": "#/$defs/EntityLink",
"description": "Workflow for parameter setpoints."
},
"validation": {
"description": "Validation rules for assigned values.",
"items": {
"$ref": "#/$defs/ValidationItem"
},
"title": "Validation",
"type": "array"
},
"prmCount": {
"description": "Number of parameter setpoints on the definition.",
"title": "Prmcount",
"type": "integer"
}
},
"required": [
"name",
"fullName",
"datacolumn",
"category",
"workflow",
"validation",
"prmCount"
],
"title": "AttributeDefinition",
"type": "object"
}
Fields:
-
name(str) -
full_name(str) -
datacolumn(EntityLinkWithName) -
category(AttributeCategory) -
unit(EntityLinkWithName | None) -
workflow(EntityLink) -
validation(list[ValidationItem]) -
prm_count(int)
AttributeValuesResponseItem
Bases: BaseAlbertModel
One attribute's reference value on a parent entity.
Show JSON schema:
{
"$defs": {
"AttributeCategory": {
"description": "Category of an inventory reference attribute.\n\n``Property``: inventory reference properties tied to a data column (e.g.\nviscosity, pH) for use in worksheets and inventory details.",
"enum": [
"Property"
],
"title": "AttributeCategory",
"type": "string"
},
"AttributeDefinition": {
"description": "Read-only attribute metadata embedded in a values response.\n\nDistinct from [`Attribute`][albert.resources.attributes.Attribute]: uses ``name``\n(not ``referenceName``) and reports ``prmCount`` instead of the full parameters list.",
"properties": {
"name": {
"description": "Attribute display name.",
"title": "Name",
"type": "string"
},
"fullName": {
"description": "Localized full name.",
"title": "Fullname",
"type": "string"
},
"datacolumn": {
"$ref": "#/$defs/EntityLinkWithName",
"description": "Data column this reference measures."
},
"category": {
"$ref": "#/$defs/AttributeCategory",
"description": "Attribute category."
},
"unit": {
"anyOf": [
{
"$ref": "#/$defs/EntityLinkWithName"
},
{
"type": "null"
}
],
"default": null,
"description": "Unit for numeric values."
},
"workflow": {
"$ref": "#/$defs/EntityLink",
"description": "Workflow for parameter setpoints."
},
"validation": {
"description": "Validation rules for assigned values.",
"items": {
"$ref": "#/$defs/ValidationItem"
},
"title": "Validation",
"type": "array"
},
"prmCount": {
"description": "Number of parameter setpoints on the definition.",
"title": "Prmcount",
"type": "integer"
}
},
"required": [
"name",
"fullName",
"datacolumn",
"category",
"workflow",
"validation",
"prmCount"
],
"title": "AttributeDefinition",
"type": "object"
},
"AttributeValueRange": {
"description": "Numeric min/max bounds for a reference value.\n\nUsed when an attribute allows a target value plus an acceptable range\n(legacy Specs ``min``/``max`` semantics).",
"properties": {
"min": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Minimum bound.",
"title": "Min"
},
"max": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Maximum bound.",
"title": "Max"
},
"comparisonOperator": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "How ``min`` and ``max`` constrain the value.",
"title": "Comparisonoperator"
}
},
"title": "AttributeValueRange",
"type": "object"
},
"DataType": {
"description": "The data type of a parameter value, driving how it is validated.\n\nUsed by [`ValueValidation`][albert.resources.parameter_groups.ValueValidation] to declare what kind of value a parameter\naccepts.\n\nAttributes\n----------\nNUMBER : str\n A numeric value.\nSTRING : str\n A free-text string value.\nENUM : str\n A value restricted to a fixed set of options (see\n [`EnumValidationValue`][albert.resources.parameter_groups.EnumValidationValue]).\nIMAGE : str\n An image value.\nCURVE : str\n A curve (series) value.\nDATE : str\n A calendar date value stored as ``YYYY-MM-DD``.\nTIMESTAMP : str\n A date-and-time value in ISO 8601 format with a UTC offset\n (e.g. ``2026-05-21T14:32:00+02:00``).",
"enum": [
"number",
"string",
"enum",
"image",
"curve",
"date",
"timestamp"
],
"title": "DataType",
"type": "string"
},
"EntityLink": {
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"category": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Category"
}
},
"required": [
"id"
],
"title": "EntityLink",
"type": "object"
},
"EntityLinkWithName": {
"description": "EntityLink that includes the name field in serialization.",
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"category": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Category"
}
},
"required": [
"id"
],
"title": "EntityLinkWithName",
"type": "object"
},
"EnumValidationValue": {
"description": "Represents a value for an enum type validation.",
"properties": {
"text": {
"description": "The text of the enum value.",
"title": "Text",
"type": "string"
},
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the enum value. If not provided, the ID will be generated upon creation.",
"title": "Id"
},
"originalText": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Originaltext"
}
},
"required": [
"text"
],
"title": "EnumValidationValue",
"type": "object"
},
"Operator": {
"description": "A comparison operator constraining a numeric parameter value.\n\nUsed by [`ValueValidation`][albert.resources.parameter_groups.ValueValidation] to bound acceptable values. ``between``\ntakes ``min`` and ``max``; every single-bound operator takes ``value`` (e.g. ``gte``\nwith ``value=\"0\"`` requires the value to be at least 0).\n\nAttributes\n----------\nBETWEEN : str\n Value must fall between ``min`` and ``max`` (inclusive).\nLESS_THAN : str\n Value must be less than ``value``.\nLESS_THAN_OR_EQUAL : str\n Value must be less than or equal to ``value``.\nGREATER_THAN_OR_EQUAL : str\n Value must be greater than or equal to ``value``.\nGREATER_THAN : str\n Value must be greater than ``value``.\nEQUALS : str\n Value must equal ``value``.\nNOT_EQUALS : str\n Not accepted by the API for parameter validations.",
"enum": [
"between",
"lt",
"lte",
"gte",
"gt",
"eq",
"neq"
],
"title": "Operator",
"type": "string"
},
"ValidationItem": {
"description": "Typed validation rule for an attribute definition.\n\nDeclares the allowed datatype (`number`, `string`, or `enum`) and optional\nconstraints. Numeric attributes may include min/max and an operator; enum\nattributes list allowed options in ``value``. Values assigned via\n[`add_values`][albert.collections.attributes.AttributeCollection.add_values]\nmust conform to these rules.",
"properties": {
"datatype": {
"anyOf": [
{
"$ref": "#/$defs/DataType"
},
{
"type": "null"
}
],
"default": null,
"description": "Allowed value type: ``number``, ``string``, or ``enum``."
},
"min": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Minimum allowed numeric value (with ``between`` or range operators).",
"title": "Min"
},
"max": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Maximum allowed numeric value (with ``between`` or range operators).",
"title": "Max"
},
"value": {
"anyOf": [
{
"type": "number"
},
{
"items": {
"$ref": "#/$defs/EnumValidationValue"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Enum allowed options, or a scalar constraint depending on ``datatype``.",
"title": "Value"
},
"operator": {
"anyOf": [
{
"$ref": "#/$defs/Operator"
},
{
"type": "null"
}
],
"default": null,
"description": "Comparison operator for numeric validation (e.g. ``between``)."
}
},
"title": "ValidationItem",
"type": "object"
}
},
"description": "One attribute's reference value on a parent entity.",
"properties": {
"albertId": {
"description": "Attribute ID.",
"title": "Albertid",
"type": "string"
},
"attributeDefinition": {
"$ref": "#/$defs/AttributeDefinition",
"description": "Metadata for the attribute definition."
},
"referenceValue": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Assigned reference value.",
"title": "Referencevalue"
},
"range": {
"anyOf": [
{
"$ref": "#/$defs/AttributeValueRange"
},
{
"type": "null"
}
],
"default": null,
"description": "Optional numeric min/max bounds."
},
"lockedAtCreation": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether this value was locked when the parent entity was created and cannot be changed.",
"title": "Lockedatcreation"
}
},
"required": [
"albertId",
"attributeDefinition"
],
"title": "AttributeValuesResponseItem",
"type": "object"
}
Fields:
-
id(AttributeId) -
attribute_definition(AttributeDefinition) -
reference_value(str | float | None) -
range(AttributeValueRange | None) -
locked_at_creation(bool | None)
attribute_definition
attribute_definition: AttributeDefinition
Metadata for the attribute definition.
locked_at_creation
locked_at_creation: bool | None = None
Whether this value was locked when the parent entity was created and cannot be changed.
AttributeValuesResponse
Bases: BaseAlbertModel
Reference values for a single parent entity (inventory item, lot, etc.).
Show JSON schema:
{
"$defs": {
"AttributeCategory": {
"description": "Category of an inventory reference attribute.\n\n``Property``: inventory reference properties tied to a data column (e.g.\nviscosity, pH) for use in worksheets and inventory details.",
"enum": [
"Property"
],
"title": "AttributeCategory",
"type": "string"
},
"AttributeDefinition": {
"description": "Read-only attribute metadata embedded in a values response.\n\nDistinct from [`Attribute`][albert.resources.attributes.Attribute]: uses ``name``\n(not ``referenceName``) and reports ``prmCount`` instead of the full parameters list.",
"properties": {
"name": {
"description": "Attribute display name.",
"title": "Name",
"type": "string"
},
"fullName": {
"description": "Localized full name.",
"title": "Fullname",
"type": "string"
},
"datacolumn": {
"$ref": "#/$defs/EntityLinkWithName",
"description": "Data column this reference measures."
},
"category": {
"$ref": "#/$defs/AttributeCategory",
"description": "Attribute category."
},
"unit": {
"anyOf": [
{
"$ref": "#/$defs/EntityLinkWithName"
},
{
"type": "null"
}
],
"default": null,
"description": "Unit for numeric values."
},
"workflow": {
"$ref": "#/$defs/EntityLink",
"description": "Workflow for parameter setpoints."
},
"validation": {
"description": "Validation rules for assigned values.",
"items": {
"$ref": "#/$defs/ValidationItem"
},
"title": "Validation",
"type": "array"
},
"prmCount": {
"description": "Number of parameter setpoints on the definition.",
"title": "Prmcount",
"type": "integer"
}
},
"required": [
"name",
"fullName",
"datacolumn",
"category",
"workflow",
"validation",
"prmCount"
],
"title": "AttributeDefinition",
"type": "object"
},
"AttributeValueRange": {
"description": "Numeric min/max bounds for a reference value.\n\nUsed when an attribute allows a target value plus an acceptable range\n(legacy Specs ``min``/``max`` semantics).",
"properties": {
"min": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Minimum bound.",
"title": "Min"
},
"max": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Maximum bound.",
"title": "Max"
},
"comparisonOperator": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "How ``min`` and ``max`` constrain the value.",
"title": "Comparisonoperator"
}
},
"title": "AttributeValueRange",
"type": "object"
},
"AttributeValuesResponseItem": {
"description": "One attribute's reference value on a parent entity.",
"properties": {
"albertId": {
"description": "Attribute ID.",
"title": "Albertid",
"type": "string"
},
"attributeDefinition": {
"$ref": "#/$defs/AttributeDefinition",
"description": "Metadata for the attribute definition."
},
"referenceValue": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Assigned reference value.",
"title": "Referencevalue"
},
"range": {
"anyOf": [
{
"$ref": "#/$defs/AttributeValueRange"
},
{
"type": "null"
}
],
"default": null,
"description": "Optional numeric min/max bounds."
},
"lockedAtCreation": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether this value was locked when the parent entity was created and cannot be changed.",
"title": "Lockedatcreation"
}
},
"required": [
"albertId",
"attributeDefinition"
],
"title": "AttributeValuesResponseItem",
"type": "object"
},
"DataType": {
"description": "The data type of a parameter value, driving how it is validated.\n\nUsed by [`ValueValidation`][albert.resources.parameter_groups.ValueValidation] to declare what kind of value a parameter\naccepts.\n\nAttributes\n----------\nNUMBER : str\n A numeric value.\nSTRING : str\n A free-text string value.\nENUM : str\n A value restricted to a fixed set of options (see\n [`EnumValidationValue`][albert.resources.parameter_groups.EnumValidationValue]).\nIMAGE : str\n An image value.\nCURVE : str\n A curve (series) value.\nDATE : str\n A calendar date value stored as ``YYYY-MM-DD``.\nTIMESTAMP : str\n A date-and-time value in ISO 8601 format with a UTC offset\n (e.g. ``2026-05-21T14:32:00+02:00``).",
"enum": [
"number",
"string",
"enum",
"image",
"curve",
"date",
"timestamp"
],
"title": "DataType",
"type": "string"
},
"EntityLink": {
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"category": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Category"
}
},
"required": [
"id"
],
"title": "EntityLink",
"type": "object"
},
"EntityLinkWithName": {
"description": "EntityLink that includes the name field in serialization.",
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"category": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Category"
}
},
"required": [
"id"
],
"title": "EntityLinkWithName",
"type": "object"
},
"EnumValidationValue": {
"description": "Represents a value for an enum type validation.",
"properties": {
"text": {
"description": "The text of the enum value.",
"title": "Text",
"type": "string"
},
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the enum value. If not provided, the ID will be generated upon creation.",
"title": "Id"
},
"originalText": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Originaltext"
}
},
"required": [
"text"
],
"title": "EnumValidationValue",
"type": "object"
},
"Operator": {
"description": "A comparison operator constraining a numeric parameter value.\n\nUsed by [`ValueValidation`][albert.resources.parameter_groups.ValueValidation] to bound acceptable values. ``between``\ntakes ``min`` and ``max``; every single-bound operator takes ``value`` (e.g. ``gte``\nwith ``value=\"0\"`` requires the value to be at least 0).\n\nAttributes\n----------\nBETWEEN : str\n Value must fall between ``min`` and ``max`` (inclusive).\nLESS_THAN : str\n Value must be less than ``value``.\nLESS_THAN_OR_EQUAL : str\n Value must be less than or equal to ``value``.\nGREATER_THAN_OR_EQUAL : str\n Value must be greater than or equal to ``value``.\nGREATER_THAN : str\n Value must be greater than ``value``.\nEQUALS : str\n Value must equal ``value``.\nNOT_EQUALS : str\n Not accepted by the API for parameter validations.",
"enum": [
"between",
"lt",
"lte",
"gte",
"gt",
"eq",
"neq"
],
"title": "Operator",
"type": "string"
},
"ValidationItem": {
"description": "Typed validation rule for an attribute definition.\n\nDeclares the allowed datatype (`number`, `string`, or `enum`) and optional\nconstraints. Numeric attributes may include min/max and an operator; enum\nattributes list allowed options in ``value``. Values assigned via\n[`add_values`][albert.collections.attributes.AttributeCollection.add_values]\nmust conform to these rules.",
"properties": {
"datatype": {
"anyOf": [
{
"$ref": "#/$defs/DataType"
},
{
"type": "null"
}
],
"default": null,
"description": "Allowed value type: ``number``, ``string``, or ``enum``."
},
"min": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Minimum allowed numeric value (with ``between`` or range operators).",
"title": "Min"
},
"max": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Maximum allowed numeric value (with ``between`` or range operators).",
"title": "Max"
},
"value": {
"anyOf": [
{
"type": "number"
},
{
"items": {
"$ref": "#/$defs/EnumValidationValue"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Enum allowed options, or a scalar constraint depending on ``datatype``.",
"title": "Value"
},
"operator": {
"anyOf": [
{
"$ref": "#/$defs/Operator"
},
{
"type": "null"
}
],
"default": null,
"description": "Comparison operator for numeric validation (e.g. ``between``)."
}
},
"title": "ValidationItem",
"type": "object"
}
},
"description": "Reference values for a single parent entity (inventory item, lot, etc.).",
"properties": {
"parentId": {
"description": "Parent entity ID (e.g. ``INVA123`` or ``LOT456``).",
"title": "Parentid",
"type": "string"
},
"attributes": {
"description": "Reference values assigned on this parent.",
"items": {
"$ref": "#/$defs/AttributeValuesResponseItem"
},
"title": "Attributes",
"type": "array"
}
},
"required": [
"parentId",
"attributes"
],
"title": "AttributeValuesResponse",
"type": "object"
}
Fields: