Sheets
albert.resources.sheets
Attributes:
| Name | Type | Description |
|---|---|---|
CellAttributeValue |
|
CellChangeId
CellChangePayload
Bases: TypedDict
Internal payload describing the patch operations to apply to a single cell.
Attributes:
| Name | Type | Description |
|---|---|---|
Id |
CellChangeId
|
|
data |
list[PatchDatum]
|
|
CellColor
A background color that can be applied to Sheet cells.
Each value is the RGB string the platform stores for the cell background.
Used with recolor_cells and recolor_cells to
highlight cells in a Sheet.
Example
Attributes:
| Name | Type | Description |
|---|---|---|
WHITE |
|
|
RED |
|
|
GREEN |
|
|
BLUE |
|
|
YELLOW |
|
|
ORANGE |
|
|
PURPLE |
|
CellType
The kind of content a Cell, Column, or Row holds.
Cells, Columns, and Rows all carry a type drawn from this enum, which
determines how the platform interprets their contents. The values most
relevant when building formulations are INVENTORY (an ingredient amount),
TOTAL (a computed total row), FORMULA and FOR (formulation
columns), LKP (a lookup that displays an inventory attribute), and
BLANK (an empty cell). CALCULATED_PROPERTY marks a calculated property
row and INGREDIENT_BASIS an ingredient basis column; the worksheet computes
their values, so they are read-only (see
update_cells); list them with
get_calculations. The remaining
members correspond to specialized grid content such as tags, prices, tasks,
results, and apps.
Attributes:
| Name | Type | Description |
|---|---|---|
INVENTORY |
|
|
APP |
|
|
BLANK |
|
|
FORMULA |
|
|
TAG |
|
|
PRICE |
|
|
PDC |
|
|
BAT |
|
|
TOTAL |
|
|
TAS |
|
|
DEF |
|
|
LKP |
|
|
FOR |
|
|
EXTINV |
|
|
BTI |
|
|
PRM |
|
|
PRG |
|
|
RSL |
|
|
FNC |
|
|
WFL |
|
|
DAC |
|
|
INT |
|
|
DAT |
|
|
NDR |
|
|
PIC |
|
|
CALCULATED_PROPERTY |
|
|
INGREDIENT_BASIS |
|
DesignType
The section of a Sheet that a Design represents.
A Sheet is organized into stacked sections, each backed by a Design
(Design). The type identifies which section:
PRODUCTS: Product Design, where formulations are built.PROCESS: Process Design.RESULTS: Results, holding Property Tasks and their data.APPS: Apps, holding insights, reporting, and notes.
Attributes:
| Name | Type | Description |
|---|---|---|
APPS |
|
|
PRODUCTS |
|
|
RESULTS |
|
|
PROCESS |
|
|
REAGENTS |
|
ColumnPosition
RowPosition
Where to insert a new row relative to a reference row.
Used by the row-adding methods of Sheet (e.g. add_lookup_row,
add_app_row) to place a new row ABOVE or BELOW an existing one.
Attributes:
| Name | Type | Description |
|---|---|---|
ABOVE |
|
|
BELOW |
|
Cell
Bases: BaseResource
A single cell in a Sheet grid, at the intersection of a Column and a Row.
A Cell is a live grid element: it carries the session and knows its position
(via column_id, row_id, and design_id) as well as its value,
calculation, and formatting. Cells are typically read from a Sheet's grid or
from cells / cells, and written back with
update_cells.
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"
},
"CellType": {
"description": "The kind of content a Cell, Column, or Row holds.\n\nCells, Columns, and Rows all carry a type drawn from this enum, which\ndetermines how the platform interprets their contents. The values most\nrelevant when building formulations are ``INVENTORY`` (an ingredient amount),\n``TOTAL`` (a computed total row), ``FORMULA`` and ``FOR`` (formulation\ncolumns), ``LKP`` (a lookup that displays an inventory attribute), and\n``BLANK`` (an empty cell). ``CALCULATED_PROPERTY`` marks a calculated property\nrow and ``INGREDIENT_BASIS`` an ingredient basis column; the worksheet computes\ntheir values, so they are read-only (see\n[`update_cells`][albert.resources.sheets.Sheet.update_cells]); list them with\n[`get_calculations`][albert.resources.sheets.Sheet.get_calculations]. The remaining\nmembers correspond to specialized grid content such as tags, prices, tasks,\nresults, and apps.",
"enum": [
"INV",
"APP",
"BLK",
"Formula",
"TAG",
"PRC",
"PDC",
"BAT",
"TOT",
"TAS",
"DEF",
"LKP",
"FOR",
"EXTINV",
"BTI",
"PRM",
"PRG",
"RSL",
"FNC",
"WFL",
"DAC",
"INT",
"DAT",
"NDR",
"PIC",
"CPR",
"IBS"
],
"title": "CellType",
"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"
}
},
"description": "A single cell in a Sheet grid, at the intersection of a Column and a Row.\n\nA Cell is a live grid element: it carries the session and knows its position\n(via ``column_id``, ``row_id``, and ``design_id``) as well as its value,\ncalculation, and formatting. Cells are typically read from a Sheet's grid or\nfrom [`cells`][albert.resources.sheets.Column.cells] / [`cells`][albert.resources.sheets.Row.cells], and written back with\n[`update_cells`][albert.resources.sheets.Sheet.update_cells].",
"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."
},
"colId": {
"description": "The ID of the Column this cell belongs to.",
"title": "Colid",
"type": "string"
},
"rowId": {
"description": "The ID of the Row this cell belongs to.",
"title": "Rowid",
"type": "string"
},
"lableName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display name of the row this cell is in.",
"title": "Lablename"
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"additionalProperties": true,
"type": "object"
},
{
"items": {},
"type": "array"
}
],
"default": "",
"description": "The value of the cell. For an inventory cell this may be a dict rather than a plain string; see [`raw_value`][albert.resources.sheets.Cell.raw_value] for the underlying value.\n\nFor **special parameters** in the Process Design grid (parameters whose value\nreferences an inventory item: equipment, consumables, raw materials), the\nlinked-cell form is the lookup string ``\"<DisplayID> || <ItemName>\"`` (double\npipe with spaces, INV prefix stripped), e.g. ``\"B90948 || Copper Coupon\"``.\nWriting a bare ``\"INV...\"`` id is accepted by the API but stored as unlinked\nplain text, so the UI shows the raw id instead of the linked item. On reads,\na linked cell's value is a dict of the form ``{\"id\": \"INVB90948\", \"name\":\n\"B90948 || Copper Coupon\"}``.\n\nFor **list-backed sheet columns** (the built-in Function column, type ``FNC``,\nand lookup columns tied to enum custom fields), set ``value`` to the list item\nid (``\"LST...\"``). Resolve allowed Function tags with\n[`get_all`][albert.collections.lists.ListsCollection.get_all] and\n``list_type=\"inventoryFunction\"``. A display name such as ``\"Dry\"`` is not a\nreference: the platform may store it as plain text or a list of strings\nwithout linking to a list item. That differs from a **calculation** on the same\ncell or row, where ``WHERE Function = \"Dry\"`` uses quoted names inside the\nexpression string (see ``calculation`` and\n[`update_cells`][albert.resources.sheets.Sheet.update_cells]).",
"title": "Value"
},
"minValue": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The minimum allowed value for inventory cells. Optional.",
"title": "Minvalue"
},
"maxValue": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The maximum allowed value for inventory cells. Optional.",
"title": "Maxvalue"
},
"type": {
"anyOf": [
{
"$ref": "#/$defs/CellType"
},
{
"type": "string"
}
],
"description": "The type of the cell. Allowed values are the same as for [`CellType`][albert.resources.sheets.CellType].",
"title": "Type"
},
"row_type": {
"anyOf": [
{
"$ref": "#/$defs/CellType"
},
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The type of the row containing this cell. Usually one of ``INV`` (inventory row), ``TOT`` (total row), ``TAS`` (task row), ``TAG``, ``PRC``, ``PDC``, ``BAT``, or ``BLK``.",
"title": "Row Type"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The name of the cell. Optional. Default is None.",
"title": "Name"
},
"calculation": {
"default": "",
"description": "The formula backing the cell, if any (e.g. a total). Default is ``\"\"``.\n\nTotals reference grid coordinates (``\"=COL5ROW12+COL6ROW12\"``). Calculated\nproperties and ingredient bases use the ingredient expression language:\n``wt%``, ``parts_mass``, ``Function``, and bracketed attributes such as\n``[Solid %]``; aggregate with ``sum(expr)`` or\n``sum(expr WHERE Function = \"Core\")`` (quoted values, ``OR`` between values\nof one key, never ``AND``). Use an ingredient basis when the value must be\nback-solved; a calculated property is read-only. The full rule set lives on\n[`update_cells`][albert.resources.sheets.Sheet.update_cells]. Malformed\nexpressions raise ``ValueError`` before anything is saved.",
"title": "Calculation",
"type": "string"
},
"design_id": {
"description": "The ID of the Design (Sheet section) this cell is in.",
"title": "Design Id",
"type": "string"
},
"cellFormat": {
"additionalProperties": true,
"description": "The cell formatting. Default is ``{}``. Keys are ``bgColor`` and ``fontColor``, with RGB string values such as ``\"RGB(255, 255, 255)\"``.",
"title": "Cellformat",
"type": "object"
},
"inventory_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Inventory Id"
}
},
"required": [
"colId",
"rowId",
"type",
"design_id"
],
"title": "Cell",
"type": "object"
}
Fields:
-
status(Status | None) -
created(AuditFields | None) -
updated(AuditFields | None) -
column_id(str) -
row_id(str) -
row_label_name(str | None) -
value(str | dict | list) -
min_value(str | None) -
max_value(str | None) -
type(CellType | str) -
row_type(CellType | str | None) -
name(str | None) -
calculation(str) -
design_id(str) -
format(dict) -
inventory_id(str | None)
value
The value of the cell. For an inventory cell this may be a dict rather than a plain string; see raw_value for the underlying value.
For special parameters in the Process Design grid (parameters whose value
references an inventory item: equipment, consumables, raw materials), the
linked-cell form is the lookup string "<DisplayID> || <ItemName>" (double
pipe with spaces, INV prefix stripped), e.g. "B90948 || Copper Coupon".
Writing a bare "INV..." id is accepted by the API but stored as unlinked
plain text, so the UI shows the raw id instead of the linked item. On reads,
a linked cell's value is a dict of the form {"id": "INVB90948", "name":
"B90948 || Copper Coupon"}.
For list-backed sheet columns (the built-in Function column, type FNC,
and lookup columns tied to enum custom fields), set value to the list item
id ("LST..."). Resolve allowed Function tags with
get_all and
list_type="inventoryFunction". A display name such as "Dry" is not a
reference: the platform may store it as plain text or a list of strings
without linking to a list item. That differs from a calculation on the same
cell or row, where WHERE Function = "Dry" uses quoted names inside the
expression string (see calculation and
update_cells).
row_type
The type of the row containing this cell. Usually one of INV (inventory row), TOT (total row), TAS (task row), TAG, PRC, PDC, BAT, or BLK.
calculation
calculation: str = ''
The formula backing the cell, if any (e.g. a total). Default is "".
Totals reference grid coordinates ("=COL5ROW12+COL6ROW12"). Calculated
properties and ingredient bases use the ingredient expression language:
wt%, parts_mass, Function, and bracketed attributes such as
[Solid %]; aggregate with sum(expr) or
sum(expr WHERE Function = "Core") (quoted values, OR between values
of one key, never AND). Use an ingredient basis when the value must be
back-solved; a calculated property is read-only. The full rule set lives on
update_cells. Malformed
expressions raise ValueError before anything is saved.
format
format: dict
The cell formatting. Default is {}. Keys are bgColor and fontColor, with RGB string values such as "RGB(255, 255, 255)".
Component
Bases: BaseResource
One ingredient and its amount within a formulation.
A Component pairs an inventory item (InventoryItem)
with the amount of it used in a formulation. Components are the input to
add_formulation and add_components_to_formulation,
which place each ingredient's amount into the appropriate Cell of a
formulation Column. Provide either inventory_item or inventory_id;
when inventory_item is given, inventory_id is populated from it
automatically.
Example
Show JSON schema:
{
"$defs": {
"ACL": {
"description": "A single access rule for a user.",
"properties": {
"id": {
"description": "The id of the user for which this ACL applies",
"title": "Id",
"type": "string"
},
"fgc": {
"anyOf": [
{
"$ref": "#/$defs/AccessControlLevel"
},
{
"type": "null"
}
],
"default": null,
"description": "The Fine-Grain Control Level"
}
},
"required": [
"id"
],
"title": "ACL",
"type": "object"
},
"AccessControlLevel": {
"description": "Access control levels you can grant users.",
"enum": [
"ProjectOwner",
"ProjectEditor",
"ProjectViewer",
"ProjectAllTask",
"ProjectStrictViewer",
"ProjectPropertyTask",
"InventoryOwner",
"InventoryViewer",
"CustomTemplateOwner",
"CustomTemplateViewer",
"CASFullAccess"
],
"title": "AccessControlLevel",
"type": "string"
},
"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"
},
"CalculatedPropertyValue": {
"description": "A calculated property value stored on a formula.\n\nA worksheet computes each calculated property for its formulas and stores the\nresult on the formula, one value per attribute. Read through\n[`calculated_properties`][albert.resources.inventory.InventoryItem.calculated_properties].\nRead-only.",
"properties": {
"value": {
"anyOf": [
{
"type": "number"
},
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The calculated value. A stored value that is not a number (e.g. ``#DIV/0!``) is kept as text. None if the stored entry has no value.",
"title": "Value"
},
"unit": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display unit of the value (e.g. ``%``), when it has one.",
"title": "Unit"
},
"updatedAt": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "When the value was last stored (ISO 8601 timestamp).",
"title": "Updatedat"
}
},
"title": "CalculatedPropertyValue",
"type": "object"
},
"Cas": {
"description": "A CAS entry: a chemical substance identified by its CAS Registry Number.\n\nA ``Cas`` is Albert's dictionary record for a substance. Raw-material Inventory\nItems reference these entries to declare what they are made of, pairing each\n``Cas`` with an amount (see [`CasAmount`][albert.resources.inventory.CasAmount]).\nManage entries through\n[`CasCollection`][albert.collections.cas.CasCollection] (``client.cas``): most fields\nare populated by Albert, so you typically only build a ``Cas`` from a registry\n``number`` when creating a new entry.\n\n!!! example\n ```python\n from albert.resources.cas import Cas\n # Build a CAS entry to register a new substance\n cas = Cas(number=\"7727-37-9\")\n ```",
"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."
},
"number": {
"description": "The CAS number.",
"title": "Number",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Name of the CAS.",
"title": "Name"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The description or name of the CAS.",
"title": "Description"
},
"notes": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Notes related to the CAS.",
"title": "Notes"
},
"category": {
"anyOf": [
{
"$ref": "#/$defs/CasCategory"
},
{
"type": "null"
}
],
"default": null,
"description": "The category of the CAS."
},
"casSmiles": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "CAS SMILES notation.",
"title": "Cassmiles"
},
"inchiKey": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "InChIKey of the CAS.",
"title": "Inchikey"
},
"iUpacName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "IUPAC name of the CAS.",
"title": "Iupacname"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The AlbertID of the CAS.",
"title": "Albertid"
},
"substanceId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "ID of the substance linked to this CAS entry. Set by the platform when the CAS is associated with a substance, otherwise None. Read-only.",
"title": "Substanceid"
},
"hazards": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/Hazard"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Hazards associated with the CAS.",
"title": "Hazards"
},
"wgk": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "German Water Hazard Class (WGK) number.",
"title": "Wgk"
},
"ecListNo": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "European Community (EC) number.",
"title": "Eclistno"
},
"type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Internal classification_type reference.",
"title": "Type"
},
"classificationType": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Classification type of the CAS.",
"title": "Classificationtype"
},
"order": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "CAS order.",
"title": "Order"
},
"Metadata": {
"additionalProperties": {
"anyOf": [
{
"type": "number"
},
{
"type": "integer"
},
{
"type": "string"
},
{
"$ref": "#/$defs/EntityLinkWithName"
},
{
"$ref": "#/$defs/EntityLink"
},
{
"items": {
"anyOf": [
{
"$ref": "#/$defs/EntityLinkWithName"
},
{
"$ref": "#/$defs/EntityLink"
}
]
},
"type": "array"
},
{
"type": "null"
}
]
},
"description": "Custom metadata keyed by field. Updatable.",
"title": "Metadata",
"type": "object"
}
},
"required": [
"number"
],
"title": "Cas",
"type": "object"
},
"CasAmount": {
"description": "A single CAS constituent and its concentration within an [`InventoryItem`][albert.resources.inventory.InventoryItem].\n\nA ``CasAmount`` links one CAS number (a chemical substance identifier) to the\namount of that substance present in an inventory item, expressed as a range\n(``min`` to ``max``) with an optional ``target``. A list of these on an\n[`InventoryItem`][albert.resources.inventory.InventoryItem] gives the item's compositional breakdown.\n\nIdentify the CAS in one of two ways: pass a full [`Cas`][albert.resources.cas.Cas]\nobject as ``cas`` (its ``id``, ``number``, and ``cas_smiles`` are then copied onto\nthis amount), or pass just the CAS resource ``id`` string. Do not pass both.\n\n!!! example\n ```python\n from albert.resources.inventory import CasAmount\n\n # Reference an existing CAS resource by its Albert ID, 10-30% concentration\n amount = CasAmount(min=10.0, max=30.0, id=\"CAS1\")\n ```",
"properties": {
"min": {
"description": "The minimum amount (concentration) of the CAS in the item.",
"title": "Min",
"type": "number"
},
"max": {
"description": "The maximum amount (concentration) of the CAS in the item.",
"title": "Max",
"type": "number"
},
"inventoryValue": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The target amount of the CAS in the item. Serialized as ``inventoryValue``.",
"title": "Inventoryvalue"
},
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert ID of the CAS resource this amount represents. Provide either a ``cas`` object or an ``id``; when ``cas`` is given, this is set from it.",
"title": "Id"
},
"casCategory": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether the CAS is a trade secret.",
"title": "Cascategory"
},
"inventoryFunction": {
"anyOf": [
{
"items": {
"anyOf": [
{
"$ref": "#/$defs/ListItem"
},
{
"$ref": "#/$defs/EntityLink"
},
{
"type": "string"
}
]
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Business-controlled functions associated with the CAS in this inventory context (e.g. what role the substance plays). Values come from a managed list.",
"title": "Inventoryfunction"
},
"type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The CAS type. Can be retrieved from the CAS collection before construction.",
"title": "Type"
},
"classificationType": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The EU classification source for the CAS: harmonized, notified, or REACH.",
"title": "Classificationtype"
},
"substanceId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The substance ID linked to this CAS entry.",
"title": "Substanceid"
},
"cas": {
"anyOf": [
{
"$ref": "#/$defs/Cas"
},
{
"type": "null"
}
],
"default": null,
"description": "The full CAS object associated with this amount. Read-only after init; excluded from serialization. Provide either a ``cas`` or an ``id``."
},
"casSmiles": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The SMILES string of the CAS resource. Read-only; set from the ``cas`` object.",
"title": "Cassmiles"
},
"number": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The CAS number (e.g. ``\"7440-32-6\"``). Read-only; set from the ``cas`` object.",
"title": "Number"
},
"Created": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null,
"description": "Audit metadata for creation. Read-only."
},
"Updated": {
"anyOf": [
{
"$ref": "#/$defs/CasAuditFieldsWithEmail"
},
{
"type": "null"
}
],
"default": null,
"description": "Audit metadata for the last update. Read-only."
}
},
"required": [
"min",
"max"
],
"title": "CasAmount",
"type": "object"
},
"CasAuditFieldsWithEmail": {
"description": "The audit fields for a CAS resource with email",
"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"
},
"email": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Email"
}
},
"title": "CasAuditFieldsWithEmail",
"type": "object"
},
"CasCategory": {
"enum": [
"User",
"Verisk",
"TSCA - Public",
"TSCA - Private",
"not TSCA",
"CAS linked to External Database",
"Unknown (Trade Secret)",
"CL_Inventory Upload"
],
"title": "CasCategory",
"type": "string"
},
"Company": {
"description": "A manufacturing company or supplier tracked in Albert.\n\nA Company is the organization that makes or supplies a material. It is the\n``company`` linked on raw-material inventory items: each raw material points\nback to the Company that manufactures it (see\n[`InventoryItem`][albert.resources.inventory.InventoryItem]). Companies are managed\nthrough [`CompanyCollection`][albert.collections.companies.CompanyCollection], accessed as\n``client.companies``.\n\nCompanies are identified by a Company ID (format ``COM...``). A Company is\ntypically minimal: a name plus its assigned ID. You construct one directly\n(``Company(name=\"Acme Chemicals\")``) to create it or to attach it to an\ninventory item.\n\n!!! example\n ```python\n from albert.resources.companies import Company\n\n # Build a company to create or attach to an inventory item\n company = Company(name=\"Acme Chemicals\")\n ```",
"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."
},
"name": {
"description": "The company's name. This is the primary identifier used when searching for or creating a company.",
"title": "Name",
"type": "string"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert Company ID (format ``COM...``). ``None`` until the company is created in or retrieved from Albert.",
"title": "Albertid"
},
"distance": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Search-relevance score returned when the company comes back as a search result. Read-only; not set on companies you build yourself.",
"title": "Distance"
}
},
"required": [
"name"
],
"title": "Company",
"type": "object"
},
"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"
},
"Hazard": {
"description": "A single GHS hazard classification associated with a CAS substance.\n\nHazards are read from the CAS record; a [`Cas`][albert.resources.cas.Cas] may carry a list of them.",
"properties": {
"subCategory": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Hazard subcategory",
"title": "Subcategory"
},
"hCode": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Hazard code",
"title": "Hcode"
},
"category": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Hazard category",
"title": "Category"
},
"class": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Hazard classification",
"title": "Class"
},
"hCodeText": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Hazard code text",
"title": "Hcodetext"
}
},
"title": "Hazard",
"type": "object"
},
"InventoryCategory": {
"description": "The kind of material an [`InventoryItem`][albert.resources.inventory.InventoryItem] represents.\n\nEvery inventory item belongs to exactly one category, which determines how it\nis used across the platform and which fields are relevant to it.\n\nAttributes\n----------\nRAW_MATERIALS : str\n A purchased substance used as an ingredient (e.g. a solvent or pigment).\n Typically linked to a manufacturing ``company`` and one or more CAS numbers.\nCONSUMABLES : str\n Lab supplies consumed during work (e.g. gloves, vials, filters).\nEQUIPMENT : str\n Instruments and apparatus (e.g. a balance or spectrometer).\nFORMULAS : str\n A mixture designed in Albert under a Project. Creating a Formula item\n requires ``project_id`` set to the parent Project's ID.\nREACTION : str\n A product of a chemical reaction recorded in Albert.",
"enum": [
"RawMaterials",
"Consumables",
"Equipment",
"Formulas",
"Reaction"
],
"title": "InventoryCategory",
"type": "string"
},
"InventoryDensity": {
"description": "The density of an inventory item or lot measured by volume.\n\nDensity is expressed in grams per milliliter (g/mL) and locked at creation.\nWhen creating a volume-based item or lot, supply either a bare numeric value\n(float, int, or string) or an [`InventoryDensity`][albert.resources.inventory.InventoryDensity]\ninstance. Metadata fields (attribute ID, unit ID, unit name, locked flag)\nare populated by the server and are read-only.\n\n!!! example\n ```python\n from albert.resources.inventory import InventoryDensity\n\n density = InventoryDensity(value=1.05)\n ```",
"properties": {
"value": {
"description": "The density value in g/mL.",
"title": "Value",
"type": "number"
},
"atrId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert ID of the density attribute definition. Read-only.",
"title": "Atrid"
},
"unitId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert ID of the density measurement unit. Read-only.",
"title": "Unitid"
},
"unitName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display name of the density measurement unit (e.g. ``g/mL``). Read-only.",
"title": "Unitname"
},
"lockedAtCreation": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether the density was locked when the parent entity was created. Read-only.",
"title": "Lockedatcreation"
}
},
"required": [
"value"
],
"title": "InventoryDensity",
"type": "object"
},
"InventoryItem": {
"description": "A catalog entry for a material tracked in Albert.\n\nAn ``InventoryItem`` is the canonical record for a raw material, consumable,\npiece of equipment, or formula. Its [`InventoryCategory`][albert.resources.inventory.InventoryCategory] determines how it\nis used across the platform, and once saved it is referenced everywhere by its\nInventory ID (format ``INV...``, e.g. ``\"INVA9999999\"``). Raw materials are typically\nlinked to a manufacturing ``company`` and a compositional breakdown of CAS\namounts. A Formula item represents a mixture designed in a Project; creating\none requires ``project_id`` set to the parent Project's ID.\n\nItems are managed through\n[`InventoryCollection`][albert.collections.inventory.InventoryCollection] (``client.inventory``).\n\n!!! example\n ```python\n from albert.resources.inventory import (\n InventoryCategory,\n InventoryDensity,\n InventoryItem,\n InventoryUnitCategory,\n )\n\n # Mass-based inventory item\n item = InventoryItem(\n name=\"Titanium Dioxide\",\n category=InventoryCategory.RAW_MATERIALS,\n company=\"Acme Chemicals\",\n )\n\n # Volume-based inventory item\n volume_item = InventoryItem(\n name=\"Isopropyl Alcohol\",\n category=InventoryCategory.RAW_MATERIALS,\n unit_category=InventoryUnitCategory.VOLUME,\n density=InventoryDensity(value=0.785),\n )\n ```",
"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."
},
"Tags": {
"anyOf": [
{
"items": {
"anyOf": [
{
"$ref": "#/$defs/Tag"
},
{
"$ref": "#/$defs/EntityLink"
}
]
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "A list of Tag objects or strings representing tags.",
"title": "Tags"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The name of the item.",
"title": "Name"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert Inventory ID (format ``INV...``). Set when the item is retrieved from or created in Albert. Serialized as ``albertId``.",
"title": "Albertid"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "A free-text description of the item.",
"title": "Description"
},
"category": {
"$ref": "#/$defs/InventoryCategory",
"description": "The kind of material this item represents. Required. One of ``RawMaterials``, ``Consumables``, ``Equipment``, ``Formulas``, or ``Reaction``."
},
"unitCategory": {
"anyOf": [
{
"$ref": "#/$defs/InventoryUnitCategory"
},
{
"type": "null"
}
],
"default": null,
"description": "The dimension the item is measured in (mass, volume, length, pressure, or units). If not supplied, it defaults from ``category``: mass for raw materials, formulas, and reaction products, units for equipment and consumables."
},
"density": {
"anyOf": [
{
"$ref": "#/$defs/InventoryDensity"
},
{
"type": "null"
}
],
"default": null,
"description": "The density in g/mL for volume-based inventory items. Required at creation when ``unit_category`` is volume. Locked at creation and cannot be changed."
},
"class": {
"anyOf": [
{
"$ref": "#/$defs/SecurityClass"
},
{
"type": "null"
}
],
"default": null,
"description": "The access/security class of the item (e.g. confidential, shared, restricted)."
},
"Company": {
"anyOf": [
{
"$ref": "#/$defs/Company"
},
{
"$ref": "#/$defs/EntityLink"
},
{
"type": "null"
}
],
"default": null,
"description": "The manufacturing Company associated with the item (links to the Company collection). Accepts a [`Company`][albert.resources.companies.Company] or a name string; a string is turned into a Company that is first-or-created on save.",
"title": "Company"
},
"minimum": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/InventoryMinimum"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Per-Location reorder thresholds for the item. See [`InventoryMinimum`][albert.resources.inventory.InventoryMinimum].",
"title": "Minimum"
},
"alias": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "An alternate name for the item.",
"title": "Alias"
},
"Cas": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/CasAmount"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "The item's compositional breakdown as CAS amounts. See [`CasAmount`][albert.resources.inventory.CasAmount].",
"title": "Cas"
},
"isFormulaOverride": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether the substance/CAS-level breakdown for this formula has been overridden from the auto-calculated value; commonly set to indicate the formula is not a non-reactive homogeneous mixture.",
"title": "Isformulaoverride"
},
"Metadata": {
"anyOf": [
{
"additionalProperties": {
"anyOf": [
{
"type": "number"
},
{
"type": "integer"
},
{
"type": "string"
},
{
"$ref": "#/$defs/EntityLinkWithName"
},
{
"$ref": "#/$defs/EntityLink"
},
{
"items": {
"anyOf": [
{
"$ref": "#/$defs/EntityLinkWithName"
},
{
"$ref": "#/$defs/EntityLink"
}
]
},
"type": "array"
},
{
"type": "null"
}
]
},
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "Custom metadata fields. Allowed keys are defined by the workspace's CustomFields configuration.",
"title": "Metadata"
},
"parentId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The parent Project ID. Required for Formulas. Serialized as ``parentId``.",
"title": "Parentid"
},
"ACL": {
"description": "Access-control entries governing who can act on the item.",
"items": {
"$ref": "#/$defs/ACL"
},
"title": "Acl",
"type": "array"
},
"onHand": {
"default": 0.0,
"description": "Total amount currently on hand across all lots. Read-only.",
"title": "Onhand",
"type": "number"
},
"onHandL": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Total amount currently on hand across all lots in litres for volume-based items. Read-only.",
"title": "Onhandl"
},
"TaskConfig": {
"anyOf": [
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Task configuration associated with the item. Read-only.",
"title": "Taskconfig"
},
"formulaId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The formula ID for a formula item. Read-only.",
"title": "Formulaid"
},
"Symbols": {
"anyOf": [
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Hazard/pictogram symbols associated with the item. Read-only.",
"title": "Symbols"
},
"unNumber": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The UN hazardous-material number, when applicable. Read-only.",
"title": "Unnumber"
},
"recentAttachmentId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the most recent attachment on the item. Read-only.",
"title": "Recentattachmentid"
},
"calculatedProperties": {
"anyOf": [
{
"additionalProperties": {
"$ref": "#/$defs/CalculatedPropertyValue"
},
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "For a formula, the calculated property values a worksheet stored, keyed by attribute ID. Only [`get_by_id`][albert.collections.inventory.InventoryCollection.get_by_id] includes them; items from other methods, and formulas with no stored value, have None. Read-only.",
"title": "Calculatedproperties"
}
},
"required": [
"category"
],
"title": "InventoryItem",
"type": "object"
},
"InventoryMinimum": {
"description": "A reorder threshold: the minimum stock of an [`InventoryItem`][albert.resources.inventory.InventoryItem] to keep at a Location.\n\nEach entry pairs one Location with the minimum quantity of an item that must be\nkept on hand there. An [`InventoryItem`][albert.resources.inventory.InventoryItem] may carry several of these, one per\nLocation. Identify the Location either by passing a full\n[`Location`][albert.resources.locations.Location] object as ``location`` (its ``id`` is\nthen copied onto ``id``), or by passing the location ``id`` string directly. Provide\none or the other, not both.\n\n!!! example\n ```python\n from albert.resources.inventory import InventoryMinimum\n\n minimum = InventoryMinimum(id=\"LOC9999999\", minimum=500)\n ```",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert ID of the Location this minimum applies to. Provide either a ``location`` or an ``id``; when ``location`` is given, this is set from it.",
"title": "Id"
},
"location": {
"anyOf": [
{
"$ref": "#/$defs/Location"
},
{
"type": "null"
}
],
"default": null,
"description": "The Location object this minimum applies to. Excluded from serialization. Provide either a ``location`` or an ``id``."
},
"minimum": {
"description": "The minimum amount of the item that must be kept in stock at the Location. Must be between 0 and 1e15.",
"maximum": 1000000000000000,
"minimum": 0,
"title": "Minimum",
"type": "number"
}
},
"required": [
"minimum"
],
"title": "InventoryMinimum",
"type": "object"
},
"InventoryUnitCategory": {
"description": "The dimension of the unit an [`InventoryItem`][albert.resources.inventory.InventoryItem] is measured and stocked in.\n\nDetermines how quantities on hand and in formulas are interpreted. When not\nsupplied, the category defaults based on [`InventoryCategory`][albert.resources.inventory.InventoryCategory]: ``MASS``\nfor raw materials, formulas, and reaction products, ``UNITS`` for equipment and consumables.\n\nAttributes\n----------\nMASS : str\n Measured by mass (e.g. grams, kilograms).\nVOLUME : str\n Measured by volume (e.g. milliliters, liters). Supported for RawMaterials\n and Consumables; requires ``density`` at creation.\nLENGTH : str\n Measured by length (e.g. meters).\nPRESSURE : str\n Measured by pressure.\nUNITS : str\n Counted as discrete units (e.g. each item).",
"enum": [
"mass",
"volume",
"length",
"pressure",
"units"
],
"title": "InventoryUnitCategory",
"type": "string"
},
"ListItem": {
"description": "A single allowed value in a configurable list of options.\n\nList items back the choices offered by ``list``-type custom fields (e.g.\ndropdown options) and other fixed option sets in Albert. A\n[`CustomField`][albert.resources.custom_fields.CustomField] with\n[`LIST`][albert.resources.custom_fields.FieldType.LIST] defines a list (keyed\nby ``list_type``, typically the field's name); its selectable options are\n``ListItem`` records with a matching ``list_type``. Managed through\n[`ListsCollection`][albert.collections.lists.ListsCollection] (``client.lists``).\n\n!!! example\n ```python\n from albert.resources.lists import ListItem, ListItemCategory\n item = ListItem(name=\"In Progress\", category=ListItemCategory.USER_DEFINED)\n ```",
"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."
},
"name": {
"description": "The display name of the list item (the option value).",
"title": "Name",
"type": "string"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert ID of the list item. Set when the item is retrieved from or created in Albert.",
"title": "Albertid"
},
"category": {
"anyOf": [
{
"$ref": "#/$defs/ListItemCategory"
},
{
"type": "null"
}
],
"default": null,
"description": "The category of the list item. Allowed values are ``businessDefined``, ``userDefined``, ``projects``, ``extensions``, and ``inventory``."
},
"listType": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The list this item belongs to. For a list-type custom field this is typically the field's name (see [`CustomField`][albert.resources.custom_fields.CustomField]). For built-in categories the allowed values are ``projectState`` for ``projects``, ``extensions`` for ``extensions``, and ``casCategory`` or ``inventoryFunction`` for ``inventory``.",
"title": "Listtype"
}
},
"required": [
"name"
],
"title": "ListItem",
"type": "object"
},
"ListItemCategory": {
"description": "The category a list item belongs to, which governs its allowed list types.\n\nAttributes\n----------\nBUSINESS_DEFINED : str\n Predefined values managed at the business/organization level.\nUSER_DEFINED : str\n Custom values defined by users.\nPROJECTS : str\n Values used by projects (e.g. project states).\nEXTENSIONS : str\n Values used by extensions.\nINVENTORY : str\n Values used by inventory (e.g. CAS categories or inventory functions).",
"enum": [
"businessDefined",
"userDefined",
"projects",
"extensions",
"inventory"
],
"title": "ListItemCategory",
"type": "string"
},
"Location": {
"description": "A physical lab or site location in Albert.\n\nLocations are referenced by Tasks and Inventory Items to record where an\nactivity is performed or where a material lives, and each Location can hold\none or more Storage Locations\n([`StorageLocation`][albert.resources.storage_locations.StorageLocation]). Managed\nthrough [`LocationCollection`][albert.collections.locations.LocationCollection].\n\n!!! example\n ```python\n from albert.resources.locations import Location\n location = Location(\n name=\"Boston Lab\",\n latitude=42.3601,\n longitude=-71.0589,\n address=\"1 Main St\",\n country=\"US\",\n )\n ```",
"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."
},
"name": {
"description": "The human-readable name of the location.",
"title": "Name",
"type": "string"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert ID of the location. Assigned by Albert and populated once the location has been created or retrieved.",
"title": "Albertid"
},
"latitude": {
"description": "The latitude of the location, in decimal degrees.",
"title": "Latitude",
"type": "number"
},
"longitude": {
"description": "The longitude of the location, in decimal degrees.",
"title": "Longitude",
"type": "number"
},
"address": {
"description": "The street address of the location.",
"title": "Address",
"type": "string"
},
"country": {
"anyOf": [
{
"maxLength": 2,
"minLength": 2,
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The two-letter country code of the location (for example, ``\"US\"``).",
"title": "Country"
}
},
"required": [
"name",
"latitude",
"longitude",
"address"
],
"title": "Location",
"type": "object"
},
"SecurityClass": {
"description": "The security (access control) class of a resource.\n\nAttributes\n----------\nSHARED : str\n Accessible to all members of the tenant.\nRESTRICTED : str\n Access is restricted to specific teams or users.\nCONFIDENTIAL : str\n Access is limited to designated users only.\nPRIVATE : str\n Visible only to the owner. Used by Projects.\nPUBLIC : str\n Accessible publicly. Returned by Parameter Groups.",
"enum": [
"shared",
"restricted",
"confidential",
"private",
"public"
],
"title": "SecurityClass",
"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"
},
"Tag": {
"description": "A freeform text label used to categorize and connect entities.\n\nTags are shared by name across the platform and can be applied to inventory\nitems, companies, tasks, and other records to group and filter them. Managed\nthrough [`TagCollection`][albert.collections.tags.TagCollection] (``client.tags``);\nthe usual entry point is [`get_or_create`][albert.collections.tags.TagCollection.get_or_create].\n\n!!! example\n ```python\n from albert.resources.tags import Tag\n tag = Tag(tag=\"high-priority\")\n ```\nMethods\n-------\nfrom_string(tag) -> Tag\n Build a Tag from its name string.",
"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."
},
"name": {
"description": "The name of the tag (its text label).",
"title": "Name",
"type": "string"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert ID of the tag (format ``TAG...``). Set when the tag is retrieved from or created in Albert. Methods ------- from_string(tag) -> Tag Build a Tag from its name string.",
"title": "Albertid"
}
},
"required": [
"name"
],
"title": "Tag",
"type": "object"
}
},
"description": "One ingredient and its amount within a formulation.\n\nA Component pairs an inventory item ([`InventoryItem`][albert.resources.inventory.InventoryItem])\nwith the amount of it used in a formulation. Components are the input to\n[`add_formulation`][albert.resources.sheets.Sheet.add_formulation] and [`add_components_to_formulation`][albert.resources.sheets.Sheet.add_components_to_formulation],\nwhich place each ingredient's amount into the appropriate Cell of a\nformulation Column. Provide either ``inventory_item`` or ``inventory_id``;\nwhen ``inventory_item`` is given, ``inventory_id`` is populated from it\nautomatically.\n\n!!! example\n ```python\n from albert.resources.sheets import Component\n component = Component(inventory_id=\"INVA9999999\", amount=42.0)\n ```",
"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."
},
"inventory_item": {
"anyOf": [
{
"$ref": "#/$defs/InventoryItem"
},
{
"type": "null"
}
],
"default": null,
"description": "The inventory item in the component. Optional when ``inventory_id`` is provided."
},
"inventory_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The inventory ID backing the component (format ``INV...``). Automatically populated from ``inventory_item`` when present; required when ``inventory_item`` is omitted.",
"title": "Inventory Id"
},
"amount": {
"description": "The amount of the inventory item in the formulation.",
"title": "Amount",
"type": "number"
},
"min_value": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The minimum allowed amount for the component. Optional.",
"title": "Min Value"
},
"max_value": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The maximum allowed amount for the component. Optional.",
"title": "Max Value"
}
},
"required": [
"amount"
],
"title": "Component",
"type": "object"
}
Fields:
-
status(Status | None) -
created(AuditFields | None) -
updated(AuditFields | None) -
inventory_item(InventoryItem | None) -
inventory_id(InventoryId | None) -
amount(float) -
min_value(float | None) -
max_value(float | None) -
_cell(Cell)
Validators:
-
_ensure_inventory_reference
inventory_item
inventory_item: InventoryItem | None = None
The inventory item in the component. Optional when inventory_id is provided.
inventory_id
inventory_id: InventoryId | None = None
The inventory ID backing the component (format INV...). Automatically populated from inventory_item when present; required when inventory_item is omitted.
FormulationSpec
Bases: BaseAlbertModel
The specification for one formulation in a bulk build.
Pairs a formulation's identity (name and/or linked inventory item) with the
components to place in its column. Used as the input to
add_formulations,
which builds many formulations at once. At least one of name or
inventory_id is required.
Example
Show JSON schema:
{
"$defs": {
"ACL": {
"description": "A single access rule for a user.",
"properties": {
"id": {
"description": "The id of the user for which this ACL applies",
"title": "Id",
"type": "string"
},
"fgc": {
"anyOf": [
{
"$ref": "#/$defs/AccessControlLevel"
},
{
"type": "null"
}
],
"default": null,
"description": "The Fine-Grain Control Level"
}
},
"required": [
"id"
],
"title": "ACL",
"type": "object"
},
"AccessControlLevel": {
"description": "Access control levels you can grant users.",
"enum": [
"ProjectOwner",
"ProjectEditor",
"ProjectViewer",
"ProjectAllTask",
"ProjectStrictViewer",
"ProjectPropertyTask",
"InventoryOwner",
"InventoryViewer",
"CustomTemplateOwner",
"CustomTemplateViewer",
"CASFullAccess"
],
"title": "AccessControlLevel",
"type": "string"
},
"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"
},
"CalculatedPropertyValue": {
"description": "A calculated property value stored on a formula.\n\nA worksheet computes each calculated property for its formulas and stores the\nresult on the formula, one value per attribute. Read through\n[`calculated_properties`][albert.resources.inventory.InventoryItem.calculated_properties].\nRead-only.",
"properties": {
"value": {
"anyOf": [
{
"type": "number"
},
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The calculated value. A stored value that is not a number (e.g. ``#DIV/0!``) is kept as text. None if the stored entry has no value.",
"title": "Value"
},
"unit": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display unit of the value (e.g. ``%``), when it has one.",
"title": "Unit"
},
"updatedAt": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "When the value was last stored (ISO 8601 timestamp).",
"title": "Updatedat"
}
},
"title": "CalculatedPropertyValue",
"type": "object"
},
"Cas": {
"description": "A CAS entry: a chemical substance identified by its CAS Registry Number.\n\nA ``Cas`` is Albert's dictionary record for a substance. Raw-material Inventory\nItems reference these entries to declare what they are made of, pairing each\n``Cas`` with an amount (see [`CasAmount`][albert.resources.inventory.CasAmount]).\nManage entries through\n[`CasCollection`][albert.collections.cas.CasCollection] (``client.cas``): most fields\nare populated by Albert, so you typically only build a ``Cas`` from a registry\n``number`` when creating a new entry.\n\n!!! example\n ```python\n from albert.resources.cas import Cas\n # Build a CAS entry to register a new substance\n cas = Cas(number=\"7727-37-9\")\n ```",
"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."
},
"number": {
"description": "The CAS number.",
"title": "Number",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Name of the CAS.",
"title": "Name"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The description or name of the CAS.",
"title": "Description"
},
"notes": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Notes related to the CAS.",
"title": "Notes"
},
"category": {
"anyOf": [
{
"$ref": "#/$defs/CasCategory"
},
{
"type": "null"
}
],
"default": null,
"description": "The category of the CAS."
},
"casSmiles": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "CAS SMILES notation.",
"title": "Cassmiles"
},
"inchiKey": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "InChIKey of the CAS.",
"title": "Inchikey"
},
"iUpacName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "IUPAC name of the CAS.",
"title": "Iupacname"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The AlbertID of the CAS.",
"title": "Albertid"
},
"substanceId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "ID of the substance linked to this CAS entry. Set by the platform when the CAS is associated with a substance, otherwise None. Read-only.",
"title": "Substanceid"
},
"hazards": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/Hazard"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Hazards associated with the CAS.",
"title": "Hazards"
},
"wgk": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "German Water Hazard Class (WGK) number.",
"title": "Wgk"
},
"ecListNo": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "European Community (EC) number.",
"title": "Eclistno"
},
"type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Internal classification_type reference.",
"title": "Type"
},
"classificationType": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Classification type of the CAS.",
"title": "Classificationtype"
},
"order": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "CAS order.",
"title": "Order"
},
"Metadata": {
"additionalProperties": {
"anyOf": [
{
"type": "number"
},
{
"type": "integer"
},
{
"type": "string"
},
{
"$ref": "#/$defs/EntityLinkWithName"
},
{
"$ref": "#/$defs/EntityLink"
},
{
"items": {
"anyOf": [
{
"$ref": "#/$defs/EntityLinkWithName"
},
{
"$ref": "#/$defs/EntityLink"
}
]
},
"type": "array"
},
{
"type": "null"
}
]
},
"description": "Custom metadata keyed by field. Updatable.",
"title": "Metadata",
"type": "object"
}
},
"required": [
"number"
],
"title": "Cas",
"type": "object"
},
"CasAmount": {
"description": "A single CAS constituent and its concentration within an [`InventoryItem`][albert.resources.inventory.InventoryItem].\n\nA ``CasAmount`` links one CAS number (a chemical substance identifier) to the\namount of that substance present in an inventory item, expressed as a range\n(``min`` to ``max``) with an optional ``target``. A list of these on an\n[`InventoryItem`][albert.resources.inventory.InventoryItem] gives the item's compositional breakdown.\n\nIdentify the CAS in one of two ways: pass a full [`Cas`][albert.resources.cas.Cas]\nobject as ``cas`` (its ``id``, ``number``, and ``cas_smiles`` are then copied onto\nthis amount), or pass just the CAS resource ``id`` string. Do not pass both.\n\n!!! example\n ```python\n from albert.resources.inventory import CasAmount\n\n # Reference an existing CAS resource by its Albert ID, 10-30% concentration\n amount = CasAmount(min=10.0, max=30.0, id=\"CAS1\")\n ```",
"properties": {
"min": {
"description": "The minimum amount (concentration) of the CAS in the item.",
"title": "Min",
"type": "number"
},
"max": {
"description": "The maximum amount (concentration) of the CAS in the item.",
"title": "Max",
"type": "number"
},
"inventoryValue": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The target amount of the CAS in the item. Serialized as ``inventoryValue``.",
"title": "Inventoryvalue"
},
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert ID of the CAS resource this amount represents. Provide either a ``cas`` object or an ``id``; when ``cas`` is given, this is set from it.",
"title": "Id"
},
"casCategory": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether the CAS is a trade secret.",
"title": "Cascategory"
},
"inventoryFunction": {
"anyOf": [
{
"items": {
"anyOf": [
{
"$ref": "#/$defs/ListItem"
},
{
"$ref": "#/$defs/EntityLink"
},
{
"type": "string"
}
]
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Business-controlled functions associated with the CAS in this inventory context (e.g. what role the substance plays). Values come from a managed list.",
"title": "Inventoryfunction"
},
"type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The CAS type. Can be retrieved from the CAS collection before construction.",
"title": "Type"
},
"classificationType": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The EU classification source for the CAS: harmonized, notified, or REACH.",
"title": "Classificationtype"
},
"substanceId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The substance ID linked to this CAS entry.",
"title": "Substanceid"
},
"cas": {
"anyOf": [
{
"$ref": "#/$defs/Cas"
},
{
"type": "null"
}
],
"default": null,
"description": "The full CAS object associated with this amount. Read-only after init; excluded from serialization. Provide either a ``cas`` or an ``id``."
},
"casSmiles": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The SMILES string of the CAS resource. Read-only; set from the ``cas`` object.",
"title": "Cassmiles"
},
"number": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The CAS number (e.g. ``\"7440-32-6\"``). Read-only; set from the ``cas`` object.",
"title": "Number"
},
"Created": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null,
"description": "Audit metadata for creation. Read-only."
},
"Updated": {
"anyOf": [
{
"$ref": "#/$defs/CasAuditFieldsWithEmail"
},
{
"type": "null"
}
],
"default": null,
"description": "Audit metadata for the last update. Read-only."
}
},
"required": [
"min",
"max"
],
"title": "CasAmount",
"type": "object"
},
"CasAuditFieldsWithEmail": {
"description": "The audit fields for a CAS resource with email",
"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"
},
"email": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Email"
}
},
"title": "CasAuditFieldsWithEmail",
"type": "object"
},
"CasCategory": {
"enum": [
"User",
"Verisk",
"TSCA - Public",
"TSCA - Private",
"not TSCA",
"CAS linked to External Database",
"Unknown (Trade Secret)",
"CL_Inventory Upload"
],
"title": "CasCategory",
"type": "string"
},
"Company": {
"description": "A manufacturing company or supplier tracked in Albert.\n\nA Company is the organization that makes or supplies a material. It is the\n``company`` linked on raw-material inventory items: each raw material points\nback to the Company that manufactures it (see\n[`InventoryItem`][albert.resources.inventory.InventoryItem]). Companies are managed\nthrough [`CompanyCollection`][albert.collections.companies.CompanyCollection], accessed as\n``client.companies``.\n\nCompanies are identified by a Company ID (format ``COM...``). A Company is\ntypically minimal: a name plus its assigned ID. You construct one directly\n(``Company(name=\"Acme Chemicals\")``) to create it or to attach it to an\ninventory item.\n\n!!! example\n ```python\n from albert.resources.companies import Company\n\n # Build a company to create or attach to an inventory item\n company = Company(name=\"Acme Chemicals\")\n ```",
"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."
},
"name": {
"description": "The company's name. This is the primary identifier used when searching for or creating a company.",
"title": "Name",
"type": "string"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert Company ID (format ``COM...``). ``None`` until the company is created in or retrieved from Albert.",
"title": "Albertid"
},
"distance": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Search-relevance score returned when the company comes back as a search result. Read-only; not set on companies you build yourself.",
"title": "Distance"
}
},
"required": [
"name"
],
"title": "Company",
"type": "object"
},
"Component": {
"description": "One ingredient and its amount within a formulation.\n\nA Component pairs an inventory item ([`InventoryItem`][albert.resources.inventory.InventoryItem])\nwith the amount of it used in a formulation. Components are the input to\n[`add_formulation`][albert.resources.sheets.Sheet.add_formulation] and [`add_components_to_formulation`][albert.resources.sheets.Sheet.add_components_to_formulation],\nwhich place each ingredient's amount into the appropriate Cell of a\nformulation Column. Provide either ``inventory_item`` or ``inventory_id``;\nwhen ``inventory_item`` is given, ``inventory_id`` is populated from it\nautomatically.\n\n!!! example\n ```python\n from albert.resources.sheets import Component\n component = Component(inventory_id=\"INVA9999999\", amount=42.0)\n ```",
"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."
},
"inventory_item": {
"anyOf": [
{
"$ref": "#/$defs/InventoryItem"
},
{
"type": "null"
}
],
"default": null,
"description": "The inventory item in the component. Optional when ``inventory_id`` is provided."
},
"inventory_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The inventory ID backing the component (format ``INV...``). Automatically populated from ``inventory_item`` when present; required when ``inventory_item`` is omitted.",
"title": "Inventory Id"
},
"amount": {
"description": "The amount of the inventory item in the formulation.",
"title": "Amount",
"type": "number"
},
"min_value": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The minimum allowed amount for the component. Optional.",
"title": "Min Value"
},
"max_value": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The maximum allowed amount for the component. Optional.",
"title": "Max Value"
}
},
"required": [
"amount"
],
"title": "Component",
"type": "object"
},
"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"
},
"Hazard": {
"description": "A single GHS hazard classification associated with a CAS substance.\n\nHazards are read from the CAS record; a [`Cas`][albert.resources.cas.Cas] may carry a list of them.",
"properties": {
"subCategory": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Hazard subcategory",
"title": "Subcategory"
},
"hCode": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Hazard code",
"title": "Hcode"
},
"category": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Hazard category",
"title": "Category"
},
"class": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Hazard classification",
"title": "Class"
},
"hCodeText": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Hazard code text",
"title": "Hcodetext"
}
},
"title": "Hazard",
"type": "object"
},
"InventoryCategory": {
"description": "The kind of material an [`InventoryItem`][albert.resources.inventory.InventoryItem] represents.\n\nEvery inventory item belongs to exactly one category, which determines how it\nis used across the platform and which fields are relevant to it.\n\nAttributes\n----------\nRAW_MATERIALS : str\n A purchased substance used as an ingredient (e.g. a solvent or pigment).\n Typically linked to a manufacturing ``company`` and one or more CAS numbers.\nCONSUMABLES : str\n Lab supplies consumed during work (e.g. gloves, vials, filters).\nEQUIPMENT : str\n Instruments and apparatus (e.g. a balance or spectrometer).\nFORMULAS : str\n A mixture designed in Albert under a Project. Creating a Formula item\n requires ``project_id`` set to the parent Project's ID.\nREACTION : str\n A product of a chemical reaction recorded in Albert.",
"enum": [
"RawMaterials",
"Consumables",
"Equipment",
"Formulas",
"Reaction"
],
"title": "InventoryCategory",
"type": "string"
},
"InventoryDensity": {
"description": "The density of an inventory item or lot measured by volume.\n\nDensity is expressed in grams per milliliter (g/mL) and locked at creation.\nWhen creating a volume-based item or lot, supply either a bare numeric value\n(float, int, or string) or an [`InventoryDensity`][albert.resources.inventory.InventoryDensity]\ninstance. Metadata fields (attribute ID, unit ID, unit name, locked flag)\nare populated by the server and are read-only.\n\n!!! example\n ```python\n from albert.resources.inventory import InventoryDensity\n\n density = InventoryDensity(value=1.05)\n ```",
"properties": {
"value": {
"description": "The density value in g/mL.",
"title": "Value",
"type": "number"
},
"atrId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert ID of the density attribute definition. Read-only.",
"title": "Atrid"
},
"unitId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert ID of the density measurement unit. Read-only.",
"title": "Unitid"
},
"unitName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display name of the density measurement unit (e.g. ``g/mL``). Read-only.",
"title": "Unitname"
},
"lockedAtCreation": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether the density was locked when the parent entity was created. Read-only.",
"title": "Lockedatcreation"
}
},
"required": [
"value"
],
"title": "InventoryDensity",
"type": "object"
},
"InventoryItem": {
"description": "A catalog entry for a material tracked in Albert.\n\nAn ``InventoryItem`` is the canonical record for a raw material, consumable,\npiece of equipment, or formula. Its [`InventoryCategory`][albert.resources.inventory.InventoryCategory] determines how it\nis used across the platform, and once saved it is referenced everywhere by its\nInventory ID (format ``INV...``, e.g. ``\"INVA9999999\"``). Raw materials are typically\nlinked to a manufacturing ``company`` and a compositional breakdown of CAS\namounts. A Formula item represents a mixture designed in a Project; creating\none requires ``project_id`` set to the parent Project's ID.\n\nItems are managed through\n[`InventoryCollection`][albert.collections.inventory.InventoryCollection] (``client.inventory``).\n\n!!! example\n ```python\n from albert.resources.inventory import (\n InventoryCategory,\n InventoryDensity,\n InventoryItem,\n InventoryUnitCategory,\n )\n\n # Mass-based inventory item\n item = InventoryItem(\n name=\"Titanium Dioxide\",\n category=InventoryCategory.RAW_MATERIALS,\n company=\"Acme Chemicals\",\n )\n\n # Volume-based inventory item\n volume_item = InventoryItem(\n name=\"Isopropyl Alcohol\",\n category=InventoryCategory.RAW_MATERIALS,\n unit_category=InventoryUnitCategory.VOLUME,\n density=InventoryDensity(value=0.785),\n )\n ```",
"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."
},
"Tags": {
"anyOf": [
{
"items": {
"anyOf": [
{
"$ref": "#/$defs/Tag"
},
{
"$ref": "#/$defs/EntityLink"
}
]
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "A list of Tag objects or strings representing tags.",
"title": "Tags"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The name of the item.",
"title": "Name"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert Inventory ID (format ``INV...``). Set when the item is retrieved from or created in Albert. Serialized as ``albertId``.",
"title": "Albertid"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "A free-text description of the item.",
"title": "Description"
},
"category": {
"$ref": "#/$defs/InventoryCategory",
"description": "The kind of material this item represents. Required. One of ``RawMaterials``, ``Consumables``, ``Equipment``, ``Formulas``, or ``Reaction``."
},
"unitCategory": {
"anyOf": [
{
"$ref": "#/$defs/InventoryUnitCategory"
},
{
"type": "null"
}
],
"default": null,
"description": "The dimension the item is measured in (mass, volume, length, pressure, or units). If not supplied, it defaults from ``category``: mass for raw materials, formulas, and reaction products, units for equipment and consumables."
},
"density": {
"anyOf": [
{
"$ref": "#/$defs/InventoryDensity"
},
{
"type": "null"
}
],
"default": null,
"description": "The density in g/mL for volume-based inventory items. Required at creation when ``unit_category`` is volume. Locked at creation and cannot be changed."
},
"class": {
"anyOf": [
{
"$ref": "#/$defs/SecurityClass"
},
{
"type": "null"
}
],
"default": null,
"description": "The access/security class of the item (e.g. confidential, shared, restricted)."
},
"Company": {
"anyOf": [
{
"$ref": "#/$defs/Company"
},
{
"$ref": "#/$defs/EntityLink"
},
{
"type": "null"
}
],
"default": null,
"description": "The manufacturing Company associated with the item (links to the Company collection). Accepts a [`Company`][albert.resources.companies.Company] or a name string; a string is turned into a Company that is first-or-created on save.",
"title": "Company"
},
"minimum": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/InventoryMinimum"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Per-Location reorder thresholds for the item. See [`InventoryMinimum`][albert.resources.inventory.InventoryMinimum].",
"title": "Minimum"
},
"alias": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "An alternate name for the item.",
"title": "Alias"
},
"Cas": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/CasAmount"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "The item's compositional breakdown as CAS amounts. See [`CasAmount`][albert.resources.inventory.CasAmount].",
"title": "Cas"
},
"isFormulaOverride": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether the substance/CAS-level breakdown for this formula has been overridden from the auto-calculated value; commonly set to indicate the formula is not a non-reactive homogeneous mixture.",
"title": "Isformulaoverride"
},
"Metadata": {
"anyOf": [
{
"additionalProperties": {
"anyOf": [
{
"type": "number"
},
{
"type": "integer"
},
{
"type": "string"
},
{
"$ref": "#/$defs/EntityLinkWithName"
},
{
"$ref": "#/$defs/EntityLink"
},
{
"items": {
"anyOf": [
{
"$ref": "#/$defs/EntityLinkWithName"
},
{
"$ref": "#/$defs/EntityLink"
}
]
},
"type": "array"
},
{
"type": "null"
}
]
},
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "Custom metadata fields. Allowed keys are defined by the workspace's CustomFields configuration.",
"title": "Metadata"
},
"parentId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The parent Project ID. Required for Formulas. Serialized as ``parentId``.",
"title": "Parentid"
},
"ACL": {
"description": "Access-control entries governing who can act on the item.",
"items": {
"$ref": "#/$defs/ACL"
},
"title": "Acl",
"type": "array"
},
"onHand": {
"default": 0.0,
"description": "Total amount currently on hand across all lots. Read-only.",
"title": "Onhand",
"type": "number"
},
"onHandL": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Total amount currently on hand across all lots in litres for volume-based items. Read-only.",
"title": "Onhandl"
},
"TaskConfig": {
"anyOf": [
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Task configuration associated with the item. Read-only.",
"title": "Taskconfig"
},
"formulaId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The formula ID for a formula item. Read-only.",
"title": "Formulaid"
},
"Symbols": {
"anyOf": [
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Hazard/pictogram symbols associated with the item. Read-only.",
"title": "Symbols"
},
"unNumber": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The UN hazardous-material number, when applicable. Read-only.",
"title": "Unnumber"
},
"recentAttachmentId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the most recent attachment on the item. Read-only.",
"title": "Recentattachmentid"
},
"calculatedProperties": {
"anyOf": [
{
"additionalProperties": {
"$ref": "#/$defs/CalculatedPropertyValue"
},
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "For a formula, the calculated property values a worksheet stored, keyed by attribute ID. Only [`get_by_id`][albert.collections.inventory.InventoryCollection.get_by_id] includes them; items from other methods, and formulas with no stored value, have None. Read-only.",
"title": "Calculatedproperties"
}
},
"required": [
"category"
],
"title": "InventoryItem",
"type": "object"
},
"InventoryMinimum": {
"description": "A reorder threshold: the minimum stock of an [`InventoryItem`][albert.resources.inventory.InventoryItem] to keep at a Location.\n\nEach entry pairs one Location with the minimum quantity of an item that must be\nkept on hand there. An [`InventoryItem`][albert.resources.inventory.InventoryItem] may carry several of these, one per\nLocation. Identify the Location either by passing a full\n[`Location`][albert.resources.locations.Location] object as ``location`` (its ``id`` is\nthen copied onto ``id``), or by passing the location ``id`` string directly. Provide\none or the other, not both.\n\n!!! example\n ```python\n from albert.resources.inventory import InventoryMinimum\n\n minimum = InventoryMinimum(id=\"LOC9999999\", minimum=500)\n ```",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert ID of the Location this minimum applies to. Provide either a ``location`` or an ``id``; when ``location`` is given, this is set from it.",
"title": "Id"
},
"location": {
"anyOf": [
{
"$ref": "#/$defs/Location"
},
{
"type": "null"
}
],
"default": null,
"description": "The Location object this minimum applies to. Excluded from serialization. Provide either a ``location`` or an ``id``."
},
"minimum": {
"description": "The minimum amount of the item that must be kept in stock at the Location. Must be between 0 and 1e15.",
"maximum": 1000000000000000,
"minimum": 0,
"title": "Minimum",
"type": "number"
}
},
"required": [
"minimum"
],
"title": "InventoryMinimum",
"type": "object"
},
"InventoryUnitCategory": {
"description": "The dimension of the unit an [`InventoryItem`][albert.resources.inventory.InventoryItem] is measured and stocked in.\n\nDetermines how quantities on hand and in formulas are interpreted. When not\nsupplied, the category defaults based on [`InventoryCategory`][albert.resources.inventory.InventoryCategory]: ``MASS``\nfor raw materials, formulas, and reaction products, ``UNITS`` for equipment and consumables.\n\nAttributes\n----------\nMASS : str\n Measured by mass (e.g. grams, kilograms).\nVOLUME : str\n Measured by volume (e.g. milliliters, liters). Supported for RawMaterials\n and Consumables; requires ``density`` at creation.\nLENGTH : str\n Measured by length (e.g. meters).\nPRESSURE : str\n Measured by pressure.\nUNITS : str\n Counted as discrete units (e.g. each item).",
"enum": [
"mass",
"volume",
"length",
"pressure",
"units"
],
"title": "InventoryUnitCategory",
"type": "string"
},
"ListItem": {
"description": "A single allowed value in a configurable list of options.\n\nList items back the choices offered by ``list``-type custom fields (e.g.\ndropdown options) and other fixed option sets in Albert. A\n[`CustomField`][albert.resources.custom_fields.CustomField] with\n[`LIST`][albert.resources.custom_fields.FieldType.LIST] defines a list (keyed\nby ``list_type``, typically the field's name); its selectable options are\n``ListItem`` records with a matching ``list_type``. Managed through\n[`ListsCollection`][albert.collections.lists.ListsCollection] (``client.lists``).\n\n!!! example\n ```python\n from albert.resources.lists import ListItem, ListItemCategory\n item = ListItem(name=\"In Progress\", category=ListItemCategory.USER_DEFINED)\n ```",
"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."
},
"name": {
"description": "The display name of the list item (the option value).",
"title": "Name",
"type": "string"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert ID of the list item. Set when the item is retrieved from or created in Albert.",
"title": "Albertid"
},
"category": {
"anyOf": [
{
"$ref": "#/$defs/ListItemCategory"
},
{
"type": "null"
}
],
"default": null,
"description": "The category of the list item. Allowed values are ``businessDefined``, ``userDefined``, ``projects``, ``extensions``, and ``inventory``."
},
"listType": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The list this item belongs to. For a list-type custom field this is typically the field's name (see [`CustomField`][albert.resources.custom_fields.CustomField]). For built-in categories the allowed values are ``projectState`` for ``projects``, ``extensions`` for ``extensions``, and ``casCategory`` or ``inventoryFunction`` for ``inventory``.",
"title": "Listtype"
}
},
"required": [
"name"
],
"title": "ListItem",
"type": "object"
},
"ListItemCategory": {
"description": "The category a list item belongs to, which governs its allowed list types.\n\nAttributes\n----------\nBUSINESS_DEFINED : str\n Predefined values managed at the business/organization level.\nUSER_DEFINED : str\n Custom values defined by users.\nPROJECTS : str\n Values used by projects (e.g. project states).\nEXTENSIONS : str\n Values used by extensions.\nINVENTORY : str\n Values used by inventory (e.g. CAS categories or inventory functions).",
"enum": [
"businessDefined",
"userDefined",
"projects",
"extensions",
"inventory"
],
"title": "ListItemCategory",
"type": "string"
},
"Location": {
"description": "A physical lab or site location in Albert.\n\nLocations are referenced by Tasks and Inventory Items to record where an\nactivity is performed or where a material lives, and each Location can hold\none or more Storage Locations\n([`StorageLocation`][albert.resources.storage_locations.StorageLocation]). Managed\nthrough [`LocationCollection`][albert.collections.locations.LocationCollection].\n\n!!! example\n ```python\n from albert.resources.locations import Location\n location = Location(\n name=\"Boston Lab\",\n latitude=42.3601,\n longitude=-71.0589,\n address=\"1 Main St\",\n country=\"US\",\n )\n ```",
"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."
},
"name": {
"description": "The human-readable name of the location.",
"title": "Name",
"type": "string"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert ID of the location. Assigned by Albert and populated once the location has been created or retrieved.",
"title": "Albertid"
},
"latitude": {
"description": "The latitude of the location, in decimal degrees.",
"title": "Latitude",
"type": "number"
},
"longitude": {
"description": "The longitude of the location, in decimal degrees.",
"title": "Longitude",
"type": "number"
},
"address": {
"description": "The street address of the location.",
"title": "Address",
"type": "string"
},
"country": {
"anyOf": [
{
"maxLength": 2,
"minLength": 2,
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The two-letter country code of the location (for example, ``\"US\"``).",
"title": "Country"
}
},
"required": [
"name",
"latitude",
"longitude",
"address"
],
"title": "Location",
"type": "object"
},
"SecurityClass": {
"description": "The security (access control) class of a resource.\n\nAttributes\n----------\nSHARED : str\n Accessible to all members of the tenant.\nRESTRICTED : str\n Access is restricted to specific teams or users.\nCONFIDENTIAL : str\n Access is limited to designated users only.\nPRIVATE : str\n Visible only to the owner. Used by Projects.\nPUBLIC : str\n Accessible publicly. Returned by Parameter Groups.",
"enum": [
"shared",
"restricted",
"confidential",
"private",
"public"
],
"title": "SecurityClass",
"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"
},
"Tag": {
"description": "A freeform text label used to categorize and connect entities.\n\nTags are shared by name across the platform and can be applied to inventory\nitems, companies, tasks, and other records to group and filter them. Managed\nthrough [`TagCollection`][albert.collections.tags.TagCollection] (``client.tags``);\nthe usual entry point is [`get_or_create`][albert.collections.tags.TagCollection.get_or_create].\n\n!!! example\n ```python\n from albert.resources.tags import Tag\n tag = Tag(tag=\"high-priority\")\n ```\nMethods\n-------\nfrom_string(tag) -> Tag\n Build a Tag from its name string.",
"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."
},
"name": {
"description": "The name of the tag (its text label).",
"title": "Name",
"type": "string"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert ID of the tag (format ``TAG...``). Set when the tag is retrieved from or created in Albert. Methods ------- from_string(tag) -> Tag Build a Tag from its name string.",
"title": "Albertid"
}
},
"required": [
"name"
],
"title": "Tag",
"type": "object"
}
},
"description": "The specification for one formulation in a bulk build.\n\nPairs a formulation's identity (name and/or linked inventory item) with the\ncomponents to place in its column. Used as the input to\n[`add_formulations`][albert.resources.sheets.Sheet.add_formulations],\nwhich builds many formulations at once. At least one of ``name`` or\n``inventory_id`` is required.\n\n!!! example\n ```python\n from albert.resources.sheets import Component, FormulationSpec\n spec = FormulationSpec(\n name=\"Formulation A\",\n components=[Component(inventory_id=\"INVA9999999\", amount=42.0)],\n )\n ```",
"properties": {
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The name of the formulation, used as the column header.\n\nOptional when ``inventory_id`` is given and matches an existing column; the\ncolumn then keeps its current header and only its ingredients are updated.\nRequired when the entry creates a new column.",
"title": "Name"
},
"inventory_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Formula inventory item backing this formulation (format ``INV...``).\n\nOptional. When provided with ``clear=True``, the existing column linked to\nthis inventory item is rebuilt in place even if its header name has\nchanged, and renamed to ``name`` when both are given and differ. The id\nmust match a column on the sheet, or the call raises before changing\nanything: a given id means this exact item, and a newly added column always\nregisters a new inventory item, so it can never satisfy a requested id.\nCannot be used with ``clear=False``. When omitted, columns are matched by\n``name`` instead.",
"title": "Inventory Id"
},
"components": {
"description": "The ingredients and their amounts to place in the formulation.",
"items": {
"$ref": "#/$defs/Component"
},
"title": "Components",
"type": "array"
}
},
"required": [
"components"
],
"title": "FormulationSpec",
"type": "object"
}
Fields:
-
name(str | None) -
inventory_id(InventoryId | None) -
components(list[Component])
Validators:
-
_ensure_identifier
name
name: str | None = None
The name of the formulation, used as the column header.
Optional when inventory_id is given and matches an existing column; the
column then keeps its current header and only its ingredients are updated.
Required when the entry creates a new column.
inventory_id
inventory_id: InventoryId | None = None
The Formula inventory item backing this formulation (format INV...).
Optional. When provided with clear=True, the existing column linked to
this inventory item is rebuilt in place even if its header name has
changed, and renamed to name when both are given and differ. The id
must match a column on the sheet, or the call raises before changing
anything: a given id means this exact item, and a newly added column always
registers a new inventory item, so it can never satisfy a requested id.
Cannot be used with clear=False. When omitted, columns are matched by
name instead.
DesignState
Bases: BaseResource
The display state of a Design section within a Sheet.
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.\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"
}
},
"description": "The display state of a Design section within a Sheet.",
"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."
},
"collapsed": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": false,
"description": "Whether the Design section is collapsed in the Sheet view. Default is False.",
"title": "Collapsed"
}
},
"title": "DesignState",
"type": "object"
}
Fields:
-
status(Status | None) -
created(AuditFields | None) -
updated(AuditFields | None) -
collapsed(bool | None)
collapsed
collapsed: bool | None = False
Whether the Design section is collapsed in the Sheet view. Default is False.
RowConfig
Bases: BaseAlbertModel
Configuration for an APP or location-type row.
Show JSON schema:
{
"description": "Configuration for an APP or location-type row.",
"properties": {
"option": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Option"
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Value"
}
},
"title": "RowConfig",
"type": "object"
}
Fields:
RowGroup
Bases: BaseAlbertModel
A named group of rows (a section) within a Design.
Show JSON schema:
{
"description": "A named group of rows (a section) within a Design.",
"properties": {
"rowId": {
"description": "The ID of the group's header row.",
"title": "Rowid",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The name of the group, shown on its header row. Optional. Default is None.",
"title": "Name"
},
"child_row_ids": {
"description": "The IDs of the rows directly inside the group, in sheet order. A section nested\ninside this one is listed by its header row ID.",
"items": {
"type": "string"
},
"title": "Child Row Ids",
"type": "array"
}
},
"required": [
"rowId"
],
"title": "RowGroup",
"type": "object"
}
Fields:
name
name: str | None = None
The name of the group, shown on its header row. Optional. Default is None.
Design
Bases: BaseSessionResource
One section of a Sheet, backing the grid for a single DesignType.
A Sheet is made up of stacked sections (Product Design, Process Design,
Results, and Apps) and each section is a Design. Designs are largely an
internal detail: most work is done through the parent Sheet, which
exposes its Designs as product_design,
result_design, app_design, and
process_design. A Design is a live grid element that carries the
session and lazily loads its rows, columns, and grid on first access.
Methods:
| Name | Description |
|---|---|
group_rows |
Create a new row group (section) within this design. |
get_groups |
Get all row groups in this design, including sections nested inside other sections. |
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"
},
"DesignState": {
"description": "The display state of a Design section within a Sheet.",
"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."
},
"collapsed": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": false,
"description": "Whether the Design section is collapsed in the Sheet view. Default is False.",
"title": "Collapsed"
}
},
"title": "DesignState",
"type": "object"
},
"DesignType": {
"description": "The section of a Sheet that a Design represents.\n\nA Sheet is organized into stacked sections, each backed by a Design\n([`Design`][albert.resources.sheets.Design]). The type identifies which section:\n\n- ``PRODUCTS``: Product Design, where formulations are built.\n- ``PROCESS``: Process Design.\n- ``RESULTS``: Results, holding Property Tasks and their data.\n- ``APPS``: Apps, holding insights, reporting, and notes.",
"enum": [
"apps",
"products",
"results",
"process",
"reagents"
],
"title": "DesignType",
"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"
}
},
"description": "One section of a Sheet, backing the grid for a single [`DesignType`][albert.resources.sheets.DesignType].\n\nA Sheet is made up of stacked sections (Product Design, Process Design,\nResults, and Apps) and each section is a Design. Designs are largely an\ninternal detail: most work is done through the parent [`Sheet`][albert.resources.sheets.Sheet], which\nexposes its Designs as [`product_design`][albert.resources.sheets.Sheet.product_design],\n[`result_design`][albert.resources.sheets.Sheet.result_design], [`app_design`][albert.resources.sheets.Sheet.app_design], and\n[`process_design`][albert.resources.sheets.Sheet.process_design]. A Design is a live grid element that carries the\nsession and lazily loads its rows, columns, and grid on first access.\nMethods\n-------\ngroup_rows(name, child_row_ids, ...) -> RowGroup\n Create a new row group (section) within this design.\nget_groups(refresh=False) -> list[RowGroup]\n Get all row groups in this design, including sections nested inside other\n sections.",
"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."
},
"state": {
"anyOf": [
{
"$ref": "#/$defs/DesignState"
},
{
"type": "null"
}
],
"default": null,
"description": "The display state of the design. Optional. Default is None."
},
"albertId": {
"description": "The Albert ID of the design.",
"title": "Albertid",
"type": "string"
},
"designType": {
"anyOf": [
{
"$ref": "#/$defs/DesignType"
},
{
"type": "string"
}
],
"description": "The section of the Sheet this design backs. See [`DesignType`][albert.resources.sheets.DesignType]. Unknown legacy/tenant values parse as plain strings.",
"title": "Designtype"
}
},
"required": [
"albertId",
"designType"
],
"title": "Design",
"type": "object"
}
Fields:
-
status(Status | None) -
created(AuditFields | None) -
updated(AuditFields | None) -
state(DesignState | None) -
id(str) -
design_type(DesignType | str)
Validators:
-
_bind_session
design_type
design_type: DesignType | str
The section of the Sheet this design backs. See DesignType. Unknown legacy/tenant values parse as plain strings.
group_rows
group_rows(
*,
name: str,
child_row_ids: list[str],
reference_id: str | None = None,
position: str = "above",
) -> RowGroup
Create a row group (section) within this design.
This always creates a new section with its own header row. To add rows to an
existing section, use
add_inventory_rows with
section_id, or move_rows
next to a row inside it.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the row group. |
required |
child_row_ids
|
list[str]
|
Row IDs to include in the group. Must contain at least one ID. |
required |
reference_id
|
str
|
The reference row ID for insertion. Defaults to the first child row. |
None
|
position
|
str
|
Position relative to |
'above'
|
Returns:
| Type | Description |
|---|---|
RowGroup
|
The created row group. |
Source code in src/albert/resources/sheets.py
get_groups
Get all row groups (sections, headers) in this design.
Sections nested inside other sections are included. Groups come in sheet order, each before the sections nested inside it.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
refresh
|
bool
|
When True, re-fetches the group list even if cached. Default is False. |
False
|
Returns:
| Type | Description |
|---|---|
list[RowGroup]
|
The row groups in this design. |
Source code in src/albert/resources/sheets.py
AppRowValue
Bases: BaseAlbertModel
One computed value of an app row, for a single column.
App rows compute one value per column of the sheet's Apps section
(for example one cost estimate per formulation column). Each
AppRowValue pairs the computed
value with the calculation that produced it.
Show JSON schema:
{
"$defs": {
"CellType": {
"description": "The kind of content a Cell, Column, or Row holds.\n\nCells, Columns, and Rows all carry a type drawn from this enum, which\ndetermines how the platform interprets their contents. The values most\nrelevant when building formulations are ``INVENTORY`` (an ingredient amount),\n``TOTAL`` (a computed total row), ``FORMULA`` and ``FOR`` (formulation\ncolumns), ``LKP`` (a lookup that displays an inventory attribute), and\n``BLANK`` (an empty cell). ``CALCULATED_PROPERTY`` marks a calculated property\nrow and ``INGREDIENT_BASIS`` an ingredient basis column; the worksheet computes\ntheir values, so they are read-only (see\n[`update_cells`][albert.resources.sheets.Sheet.update_cells]); list them with\n[`get_calculations`][albert.resources.sheets.Sheet.get_calculations]. The remaining\nmembers correspond to specialized grid content such as tags, prices, tasks,\nresults, and apps.",
"enum": [
"INV",
"APP",
"BLK",
"Formula",
"TAG",
"PRC",
"PDC",
"BAT",
"TOT",
"TAS",
"DEF",
"LKP",
"FOR",
"EXTINV",
"BTI",
"PRM",
"PRG",
"RSL",
"FNC",
"WFL",
"DAC",
"INT",
"DAT",
"NDR",
"PIC",
"CPR",
"IBS"
],
"title": "CellType",
"type": "string"
}
},
"description": "One computed value of an app row, for a single column.\n\nApp rows compute one value per column of the sheet's Apps section\n(for example one cost estimate per formulation column). Each\n[`AppRowValue`][albert.resources.sheets.AppRowValue] pairs the computed\n``value`` with the ``calculation`` that produced it.",
"properties": {
"colId": {
"description": "The ID of the column the value belongs to.",
"title": "Colid",
"type": "string"
},
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the inventory item behind the column, when the column holds one (format ``INV...``). Optional. Default is None.",
"title": "Id"
},
"type": {
"anyOf": [
{
"$ref": "#/$defs/CellType"
},
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The type of the column. Optional. Default is None.",
"title": "Type"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display name of the column. Optional. Default is None.",
"title": "Name"
},
"value": {
"default": "",
"description": "The value computed by the app for the column. Default is ``\"\"``.",
"title": "Value",
"type": "string"
},
"calculation": {
"default": "",
"description": "The calculation that produced ``value``, as a serialized expression, when the\nvalue was computed from one. Pairs each computed value with the calculation behind\nit; an empty string means the value was not computed from a calculation. Default is ``\"\"``.",
"title": "Calculation",
"type": "string"
}
},
"required": [
"colId"
],
"title": "AppRowValue",
"type": "object"
}
Fields:
-
column_id(str) -
id(str | None) -
type(CellType | str | None) -
name(str | None) -
value(str) -
calculation(str)
id
id: str | None = None
The ID of the inventory item behind the column, when the column holds one (format INV...). Optional. Default is None.
calculation
calculation: str = ''
The calculation that produced value, as a serialized expression, when the
value was computed from one. Pairs each computed value with the calculation behind
it; an empty string means the value was not computed from a calculation. Default is "".
AppRow
Bases: BaseAlbertModel
An application (APP) row in a sheet's Apps section, with its computed values.
Read app rows with
get_app_rows; add one with
add_app_row.
Show JSON schema:
{
"$defs": {
"AppRowValue": {
"description": "One computed value of an app row, for a single column.\n\nApp rows compute one value per column of the sheet's Apps section\n(for example one cost estimate per formulation column). Each\n[`AppRowValue`][albert.resources.sheets.AppRowValue] pairs the computed\n``value`` with the ``calculation`` that produced it.",
"properties": {
"colId": {
"description": "The ID of the column the value belongs to.",
"title": "Colid",
"type": "string"
},
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the inventory item behind the column, when the column holds one (format ``INV...``). Optional. Default is None.",
"title": "Id"
},
"type": {
"anyOf": [
{
"$ref": "#/$defs/CellType"
},
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The type of the column. Optional. Default is None.",
"title": "Type"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display name of the column. Optional. Default is None.",
"title": "Name"
},
"value": {
"default": "",
"description": "The value computed by the app for the column. Default is ``\"\"``.",
"title": "Value",
"type": "string"
},
"calculation": {
"default": "",
"description": "The calculation that produced ``value``, as a serialized expression, when the\nvalue was computed from one. Pairs each computed value with the calculation behind\nit; an empty string means the value was not computed from a calculation. Default is ``\"\"``.",
"title": "Calculation",
"type": "string"
}
},
"required": [
"colId"
],
"title": "AppRowValue",
"type": "object"
},
"CellType": {
"description": "The kind of content a Cell, Column, or Row holds.\n\nCells, Columns, and Rows all carry a type drawn from this enum, which\ndetermines how the platform interprets their contents. The values most\nrelevant when building formulations are ``INVENTORY`` (an ingredient amount),\n``TOTAL`` (a computed total row), ``FORMULA`` and ``FOR`` (formulation\ncolumns), ``LKP`` (a lookup that displays an inventory attribute), and\n``BLANK`` (an empty cell). ``CALCULATED_PROPERTY`` marks a calculated property\nrow and ``INGREDIENT_BASIS`` an ingredient basis column; the worksheet computes\ntheir values, so they are read-only (see\n[`update_cells`][albert.resources.sheets.Sheet.update_cells]); list them with\n[`get_calculations`][albert.resources.sheets.Sheet.get_calculations]. The remaining\nmembers correspond to specialized grid content such as tags, prices, tasks,\nresults, and apps.",
"enum": [
"INV",
"APP",
"BLK",
"Formula",
"TAG",
"PRC",
"PDC",
"BAT",
"TOT",
"TAS",
"DEF",
"LKP",
"FOR",
"EXTINV",
"BTI",
"PRM",
"PRG",
"RSL",
"FNC",
"WFL",
"DAC",
"INT",
"DAT",
"NDR",
"PIC",
"CPR",
"IBS"
],
"title": "CellType",
"type": "string"
}
},
"description": "An application (APP) row in a sheet's Apps section, with its computed values.\n\nRead app rows with\n[`get_app_rows`][albert.resources.sheets.Sheet.get_app_rows]; add one with\n[`add_app_row`][albert.resources.sheets.Sheet.add_app_row].",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the application the row runs (format ``APP...``). Optional. Default is None.",
"title": "Id"
},
"rowId": {
"description": "The ID of the row.",
"title": "Rowid",
"type": "string"
},
"rowUniqueId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The unique ID of the row within the worksheet. Optional. Default is None.",
"title": "Rowuniqueid"
},
"type": {
"anyOf": [
{
"$ref": "#/$defs/CellType"
},
{
"type": "string"
}
],
"description": "The type of the row; ``APP`` for app rows.",
"title": "Type"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display name of the row. Optional. Default is None.",
"title": "Name"
},
"Values": {
"description": "The computed values of the row, one per column.",
"items": {
"$ref": "#/$defs/AppRowValue"
},
"title": "Values",
"type": "array"
}
},
"required": [
"rowId",
"type"
],
"title": "AppRow",
"type": "object"
}
Fields:
SheetFormulationRef
Bases: BaseAlbertModel
A reference to a formulation in a sheet
Show JSON schema:
{
"description": "A reference to a formulation in a sheet",
"properties": {
"id": {
"description": "The Albert ID of the inventory item that is the formulation",
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The name of the formulation",
"title": "Name"
},
"hidden": {
"description": "Whether the formulation is hidden",
"title": "Hidden",
"type": "boolean"
}
},
"required": [
"id",
"hidden"
],
"title": "SheetFormulationRef",
"type": "object"
}
Fields:
SheetCalculation
Bases: BaseAlbertModel
An ingredient basis or calculated property shown on a sheet.
The formula itself lives on the attribute: its
FormulaMetadata entry with the same
display_name holds the expression.
Show JSON schema:
{
"description": "An ingredient basis or calculated property shown on a sheet.\n\nThe formula itself lives on the attribute: its\n[`FormulaMetadata`][albert.resources.attributes.FormulaMetadata] entry with the same\n``display_name`` holds the expression.",
"properties": {
"id": {
"description": "The ID of the attribute that defines the formula (format ``ATR...``).",
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The formula's display name. An ingredient basis column and a calculated property\nrow on the sheet carry this name. Optional. Default is None.",
"title": "Name"
}
},
"required": [
"id"
],
"title": "SheetCalculation",
"type": "object"
}
Fields:
-
attribute_id(str) -
name(str | None)
SheetCalculations
Bases: BaseAlbertModel
The ingredient bases, calculated properties and attributes a sheet uses.
This is what the sheet's Manage Worksheet panel shows. Each ingredient basis adds a
column under every formula column
(INGREDIENT_BASIS), and each
calculated property adds a row in the Calculated Properties group
(CALCULATED_PROPERTY). The
worksheet computes their values when the sheet is open in Albert.
Read them with get_calculations.
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"
},
"SheetCalculation": {
"description": "An ingredient basis or calculated property shown on a sheet.\n\nThe formula itself lives on the attribute: its\n[`FormulaMetadata`][albert.resources.attributes.FormulaMetadata] entry with the same\n``display_name`` holds the expression.",
"properties": {
"id": {
"description": "The ID of the attribute that defines the formula (format ``ATR...``).",
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The formula's display name. An ingredient basis column and a calculated property\nrow on the sheet carry this name. Optional. Default is None.",
"title": "Name"
}
},
"required": [
"id"
],
"title": "SheetCalculation",
"type": "object"
}
},
"description": "The ingredient bases, calculated properties and attributes a sheet uses.\n\nThis is what the sheet's Manage Worksheet panel shows. Each ingredient basis adds a\ncolumn under every formula column\n([`INGREDIENT_BASIS`][albert.resources.sheets.CellType.INGREDIENT_BASIS]), and each\ncalculated property adds a row in the Calculated Properties group\n([`CALCULATED_PROPERTY`][albert.resources.sheets.CellType.CALCULATED_PROPERTY]). The\nworksheet computes their values when the sheet is open in Albert.\n\nRead them with [`get_calculations`][albert.resources.sheets.Sheet.get_calculations].",
"properties": {
"attributes": {
"description": "The attributes the sheet uses, by ID and name. A sheet can use at most 10.",
"items": {
"$ref": "#/$defs/EntityLinkWithName"
},
"title": "Attributes",
"type": "array"
},
"ingredientBasis": {
"description": "The ingredient bases on the sheet.",
"items": {
"$ref": "#/$defs/SheetCalculation"
},
"title": "Ingredientbasis",
"type": "array"
},
"calculatedProperty": {
"description": "The calculated properties on the sheet.",
"items": {
"$ref": "#/$defs/SheetCalculation"
},
"title": "Calculatedproperty",
"type": "array"
}
},
"title": "SheetCalculations",
"type": "object"
}
Fields:
-
attributes(list[EntityLinkWithName]) -
ingredient_bases(list[SheetCalculation]) -
calculated_properties(list[SheetCalculation])
attributes
attributes: list[EntityLinkWithName]
The attributes the sheet uses, by ID and name. A sheet can use at most 10.
calculated_properties
calculated_properties: list[SheetCalculation]
The calculated properties on the sheet.
Sheet
Bases: BaseSessionResource
An interactive grid within a Worksheet where formulations are built.
A Sheet is one grid inside a Worksheet (Worksheet).
It is organized into stacked sections, each a Design: Product Design
(where formulations are built), Process Design, Results (Property Tasks and
their data), and Apps (insights and notes). Access those sections through
product_design, process_design, result_design, and
app_design.
A Sheet Column can be a formulation (the most common case for the SDK), a lookup column that displays an inventory attribute, or an ingredient name. Rows typically represent ingredients (inventory items) and their amounts. Adding a formulation to a Sheet is what registers a Formula inventory item.
The Sheet is a live grid element that carries the session; its cells, columns,
and rows are themselves interactive. Retrieve a Sheet from a Worksheet's
sheets, then edit it in place
with the methods below.
Example
Methods:
| Name | Description |
|---|---|
rename |
Rename the sheet. |
add_formulation |
Build a formulation column from a list of components (registers a Formula). |
add_formulations |
Build multiple formulations in one call, sharing ingredient rows. |
add_components_to_formulation |
Add components to an existing formulation column. |
add_formulation_columns |
Add one or more empty formulation columns. |
add_inventory_row |
Add an ingredient (inventory) row, optionally into a section. |
add_inventory_rows |
Add multiple ingredient (inventory) rows in one call, optionally into a section. |
add_blank_row |
Add a blank row. |
add_blank_rows |
Add multiple blank rows in one call. |
add_lookup_row |
Add a lookup row. |
add_app_row |
Add an application row. |
get_app_rows |
Get the app rows of the Apps section, with their computed values. |
get_calculations |
Get the ingredient bases and calculated properties on the sheet (Manage Worksheet). |
add_calculation |
Add an ingredient basis or calculated property to the sheet. |
remove_calculation |
Remove an ingredient basis or calculated property from the sheet. |
add_parameter_group_row |
Add a parameter group (PRG) row to Process Design. |
add_task_row |
Link a task into the Results section as a task (TAS) row. |
add_blank_column |
Add a blank column. |
add_columns |
Add multiple columns of one type in one call. |
add_lookup_column |
Add a lookup column. |
add_function_column |
Add a function column. |
add_property_column |
Add a property/result column. |
get_column |
Retrieve a column by column ID, inventory ID, or name. |
update_cells |
Write changed cells back to the sheet. |
pin_columns |
Pin columns to the left or right edge. |
unpin_columns |
Unpin columns. |
lock_column |
Lock or unlock a column. |
lock_columns |
Lock or unlock multiple columns in one call. |
rename_columns |
Rename multiple columns in one call. |
hide_column |
Hide a column. |
hide_columns |
Hide multiple columns in one call. |
show_column |
Show a hidden column. |
show_columns |
Show multiple hidden columns in one call. |
set_columns_width |
Set the display width of columns. |
reorder_columns |
Reorder all columns left to right by column ID. |
delete_column |
Delete a column. |
delete_columns |
Delete multiple columns in one call. |
delete_row |
Delete a row. |
delete_rows |
Delete multiple rows from a Design section in one call. |
move_rows |
Move (reorder) rows within a Design section, above or below a reference row. |
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"
},
"Design": {
"description": "One section of a Sheet, backing the grid for a single [`DesignType`][albert.resources.sheets.DesignType].\n\nA Sheet is made up of stacked sections (Product Design, Process Design,\nResults, and Apps) and each section is a Design. Designs are largely an\ninternal detail: most work is done through the parent [`Sheet`][albert.resources.sheets.Sheet], which\nexposes its Designs as [`product_design`][albert.resources.sheets.Sheet.product_design],\n[`result_design`][albert.resources.sheets.Sheet.result_design], [`app_design`][albert.resources.sheets.Sheet.app_design], and\n[`process_design`][albert.resources.sheets.Sheet.process_design]. A Design is a live grid element that carries the\nsession and lazily loads its rows, columns, and grid on first access.\nMethods\n-------\ngroup_rows(name, child_row_ids, ...) -> RowGroup\n Create a new row group (section) within this design.\nget_groups(refresh=False) -> list[RowGroup]\n Get all row groups in this design, including sections nested inside other\n sections.",
"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."
},
"state": {
"anyOf": [
{
"$ref": "#/$defs/DesignState"
},
{
"type": "null"
}
],
"default": null,
"description": "The display state of the design. Optional. Default is None."
},
"albertId": {
"description": "The Albert ID of the design.",
"title": "Albertid",
"type": "string"
},
"designType": {
"anyOf": [
{
"$ref": "#/$defs/DesignType"
},
{
"type": "string"
}
],
"description": "The section of the Sheet this design backs. See [`DesignType`][albert.resources.sheets.DesignType]. Unknown legacy/tenant values parse as plain strings.",
"title": "Designtype"
}
},
"required": [
"albertId",
"designType"
],
"title": "Design",
"type": "object"
},
"DesignState": {
"description": "The display state of a Design section within a Sheet.",
"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."
},
"collapsed": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": false,
"description": "Whether the Design section is collapsed in the Sheet view. Default is False.",
"title": "Collapsed"
}
},
"title": "DesignState",
"type": "object"
},
"DesignType": {
"description": "The section of a Sheet that a Design represents.\n\nA Sheet is organized into stacked sections, each backed by a Design\n([`Design`][albert.resources.sheets.Design]). The type identifies which section:\n\n- ``PRODUCTS``: Product Design, where formulations are built.\n- ``PROCESS``: Process Design.\n- ``RESULTS``: Results, holding Property Tasks and their data.\n- ``APPS``: Apps, holding insights, reporting, and notes.",
"enum": [
"apps",
"products",
"results",
"process",
"reagents"
],
"title": "DesignType",
"type": "string"
},
"SheetFormulationRef": {
"description": "A reference to a formulation in a sheet",
"properties": {
"id": {
"description": "The Albert ID of the inventory item that is the formulation",
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The name of the formulation",
"title": "Name"
},
"hidden": {
"description": "Whether the formulation is hidden",
"title": "Hidden",
"type": "boolean"
}
},
"required": [
"id",
"hidden"
],
"title": "SheetFormulationRef",
"type": "object"
},
"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"
}
},
"description": "An interactive grid within a Worksheet where formulations are built.\n\nA Sheet is one grid inside a Worksheet ([`Worksheet`][albert.resources.worksheets.Worksheet]).\nIt is organized into stacked sections, each a [`Design`][albert.resources.sheets.Design]: Product Design\n(where formulations are built), Process Design, Results (Property Tasks and\ntheir data), and Apps (insights and notes). Access those sections through\n[`product_design`][albert.resources.sheets.Sheet.product_design], [`process_design`][albert.resources.sheets.Sheet.process_design], [`result_design`][albert.resources.sheets.Sheet.result_design], and\n[`app_design`][albert.resources.sheets.Sheet.app_design].\n\nA Sheet Column can be a formulation (the most common case for the SDK), a\nlookup column that displays an inventory attribute, or an ingredient name.\nRows typically represent ingredients (inventory items) and their amounts.\nAdding a formulation to a Sheet is what registers a Formula inventory item.\n\nThe Sheet is a live grid element that carries the session; its cells, columns,\nand rows are themselves interactive. Retrieve a Sheet from a Worksheet's\n[`sheets`][albert.resources.worksheets.Worksheet.sheets], then edit it in place\nwith the methods below.\n\n!!! example\n ```python\n from albert import Albert\n client = Albert()\n worksheet = client.worksheets.get_by_project_id(project_id=\"PROA9999999\")\n sheet = worksheet.sheets[0]\n print(sheet.grid)\n ```\nMethods\n-------\nrename(new_name) -> Sheet\n Rename the sheet.\nadd_formulation(formulation_name, components, ...) -> Column\n Build a formulation column from a list of components (registers a Formula).\nadd_formulations(formulations) -> list[Column]\n Build multiple formulations in one call, sharing ingredient rows.\nadd_components_to_formulation(components, ...) -> Column\n Add components to an existing formulation column.\nadd_formulation_columns(formulation_names, ...) -> list[Column]\n Add one or more empty formulation columns.\nadd_inventory_row(inventory_id, ...) -> Row\n Add an ingredient (inventory) row, optionally into a section.\nadd_inventory_rows(inventory_ids, ...) -> list[Row]\n Add multiple ingredient (inventory) rows in one call, optionally into a section.\nadd_blank_row(row_name, ...) -> Row\n Add a blank row.\nadd_blank_rows(row_names, ...) -> list[Row]\n Add multiple blank rows in one call.\nadd_lookup_row(name, ...) -> Row\n Add a lookup row.\nadd_app_row(app_id, name, ...) -> Row\n Add an application row.\nget_app_rows() -> list[AppRow]\n Get the app rows of the Apps section, with their computed values.\nget_calculations() -> SheetCalculations\n Get the ingredient bases and calculated properties on the sheet (Manage Worksheet).\nadd_calculation(attribute_id, display_name) -> SheetCalculations\n Add an ingredient basis or calculated property to the sheet.\nremove_calculation(attribute_id, display_name) -> SheetCalculations\n Remove an ingredient basis or calculated property from the sheet.\nadd_parameter_group_row(parameter_group_id, ...) -> Row\n Add a parameter group (PRG) row to Process Design.\nadd_task_row(task_id, ...) -> Row\n Link a task into the Results section as a task (TAS) row.\nadd_blank_column(name, ...) -> Column\n Add a blank column.\nadd_columns(names, ...) -> list[Column]\n Add multiple columns of one type in one call.\nadd_lookup_column(name, ...) -> Column\n Add a lookup column.\nadd_function_column(name, ...) -> Column\n Add a function column.\nadd_property_column(name, attribute_id, ...) -> Column\n Add a property/result column.\nget_column(...) -> Column\n Retrieve a column by column ID, inventory ID, or name.\nupdate_cells(cells) -> tuple[list[Cell], list[Cell]]\n Write changed cells back to the sheet.\npin_columns(col_ids, side) -> None\n Pin columns to the left or right edge.\nunpin_columns(col_ids) -> None\n Unpin columns.\nlock_column(...) -> Column\n Lock or unlock a column.\nlock_columns(column_ids, locked=True) -> None\n Lock or unlock multiple columns in one call.\nrename_columns(columns) -> None\n Rename multiple columns in one call.\nhide_column(col_id) -> None\n Hide a column.\nhide_columns(column_ids) -> None\n Hide multiple columns in one call.\nshow_column(col_id) -> None\n Show a hidden column.\nshow_columns(column_ids) -> None\n Show multiple hidden columns in one call.\nset_columns_width(col_ids, width) -> None\n Set the display width of columns.\nreorder_columns(column_ids) -> None\n Reorder all columns left to right by column ID.\ndelete_column(column_id) -> None\n Delete a column.\ndelete_columns(column_ids) -> None\n Delete multiple columns in one call.\ndelete_row(row_id, design_id) -> None\n Delete a row.\ndelete_rows(row_ids, design_id) -> None\n Delete multiple rows from a Design section in one call.\nmove_rows(row_ids, reference_id, design_id, ...) -> None\n Move (reorder) rows within a Design section, above or below a reference row.",
"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": {
"description": "The Albert ID of the sheet.",
"title": "Albertid",
"type": "string"
},
"name": {
"description": "The name of the sheet.",
"title": "Name",
"type": "string"
},
"Formulas": {
"description": "References to the formulations present on the sheet.",
"items": {
"$ref": "#/$defs/SheetFormulationRef"
},
"title": "Formulas",
"type": "array"
},
"hidden": {
"description": "Whether the sheet is hidden.",
"title": "Hidden",
"type": "boolean"
},
"isColumnRight": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "When True, copied columns are placed to the right of the source column; when False, to the left.",
"title": "Iscolumnright"
},
"colSizeMode": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Column width sizing mode. Allowed values are ``\"minimum\"`` and ``\"fitToColumn\"``. ``None`` resets to the default grid width.",
"title": "Colsizemode"
},
"Designs": {
"description": "The Designs (sections) of the sheet.",
"items": {
"$ref": "#/$defs/Design"
},
"title": "Designs",
"type": "array"
},
"projectId": {
"description": "The ID of the Project the sheet belongs to (format ``PRO...``).",
"title": "Projectid",
"type": "string"
}
},
"required": [
"albertId",
"name",
"hidden",
"Designs",
"projectId"
],
"title": "Sheet",
"type": "object"
}
Fields:
-
status(Status | None) -
created(AuditFields | None) -
updated(AuditFields | None) -
id(str) -
name(str) -
formulations(list[SheetFormulationRef]) -
hidden(bool) -
is_column_right(bool | None) -
col_size_mode(str | None) -
designs(list[Design]) -
project_id(str)
Validators:
-
_bind_session -
set_session -
set_sheet_fields
formulations
formulations: list[SheetFormulationRef]
References to the formulations present on the sheet.
is_column_right
is_column_right: bool | None = None
When True, copied columns are placed to the right of the source column; when False, to the left.
col_size_mode
col_size_mode: str | None = None
Column width sizing mode. Allowed values are "minimum" and "fitToColumn". None resets to the default grid width.
set_session
set_sheet_fields
set_sheet_fields() -> Sheet
Source code in src/albert/resources/sheets.py
rename
rename(*, new_name: str)
Rename this sheet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
new_name
|
str
|
The new name for the sheet. |
required |
Returns:
| Type | Description |
|---|---|
Sheet
|
This sheet, with its name updated. |
Source code in src/albert/resources/sheets.py
add_formulation
add_formulation(
*,
formulation_name: str,
components: list[Component],
inventory_id: InventoryId | None = None,
enforce_order: bool = False,
clear: bool = True,
) -> Column
Build a formulation on this sheet from a list of components.
This is the primary way to create a formulation. Each component
(Component) contributes an ingredient and its amount, which are
written into a formulation column. Adding rows for any new ingredients and
maintaining the column's Total cell are handled automatically. Building a
formulation this way is what registers a Formula inventory item
(InventoryItem).
If a column named formulation_name already exists and clear is True,
that column is emptied and reused; otherwise a new formulation column is added.
When a new ingredient row is added, unlocked formula columns have their Total
formula extended to include that row. Locked formula columns are left unchanged.
To build many formulations at once, use
add_formulations, which is
substantially faster for bulk loads.
Concurrent use
Do not run this method concurrently with other writes to the same
sheet, whether from threads, processes, or separate machines. The
platform coordinates each sheet's structure through shared records
that reject simultaneous updates, so concurrent writers to one
sheet can fail partway, sometimes with errors that incorrectly
report duplicate names. Concurrent use across different sheets is
safe, because each sheet is processed independently. To load many
formulations, prefer one
add_formulations
call over many concurrent add_formulation calls.
Example
from albert import Albert
from albert.resources.sheets import Component
client = Albert()
worksheet = client.worksheets.get_by_project_id(project_id="PROA9999999")
sheet = worksheet.sheets[0]
column = sheet.add_formulation(
formulation_name="Formulation A",
components=[
Component(inventory_id="INVA9999999", amount=80.0),
Component(inventory_id="INVA9999998", amount=20.0),
],
)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
formulation_name
|
str
|
The name of the formulation, used as the column header. |
required |
components
|
list[Component]
|
The ingredients and their amounts to place in the formulation. |
required |
inventory_id
|
InventoryId
|
The inventory ID of an existing formulation column to target
(format |
None
|
enforce_order
|
bool
|
When True, ingredient rows are arranged to match the order of
|
False
|
clear
|
bool
|
When True, an existing column with the same name is cleared and reused rather than adding a duplicate. Default is True. |
True
|
Returns:
| Type | Description |
|---|---|
Column
|
The formulation column that was created or updated. |
Raises:
| Type | Description |
|---|---|
AlbertPartialError
|
If some ingredient amounts or Total cells could not be written. When ingredient amounts fail, a reused column is restored to its previous contents; read the sheet again and retry. |
Source code in src/albert/resources/sheets.py
1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 | |
add_formulations
add_formulations(
*,
formulations: list[FormulationSpec],
enforce_order: bool = False,
clear: bool = True,
) -> list[Column]
Build multiple formulations on this sheet in one operation.
Each entry builds a formulation column from its components, exactly like
add_formulation, but
substantially faster when adding many formulations: ingredient rows are
shared across all formulations in the list and created only for inventory
items not already on the sheet, and unlocked formula columns have their
Total formulas extended to cover new rows once at the end rather than
after every formulation.
With clear=True (the default), an entry whose name matches an
existing column on this sheet updates that column in place: the column
is emptied and rebuilt from the entry's components, and no new column is
added. An entry that sets inventory_id instead matches the column
linked to that inventory item, even when its header name has changed,
and the column is renamed to the entry's name when both are given
and differ. An entry with only inventory_id (no name) updates just
the matched column's ingredients and keeps its header. An entry whose
inventory_id matches no column fails before anything is changed: a
given id means this exact item, and a newly added column always
registers a new inventory item, so it can never satisfy a requested id.
Entries in one call must not repeat an inventory_id or a name,
and an id linked to more than one column raises, since neither could
resolve to a single column. Re-running a call after a failure is
therefore safe. Renames are applied only after the matched columns'
contents are in place, so a failed rename leaves the ingredients
written with a stale header, and re-running the same call finishes the
rename because entries match by inventory item rather than header.
With clear=False, a new column is added for every entry and
existing columns are left untouched; inventory_id cannot be used in
that mode. Duplicate names can then be rejected by the platform, so
keep names unique within the list and within the sheet.
The platform recommends at most 100 columns per sheet for performance;
the limit is not enforced.
Building a formulation this way is what registers a Formula inventory
item (InventoryItem).
Concurrent use
Do not run this method concurrently with other writes to the same sheet, whether from threads, processes, or separate machines. The platform coordinates each sheet's structure through shared records that reject simultaneous updates, so concurrent writers to one sheet can fail partway, sometimes with errors that incorrectly report duplicate names. Concurrent use across different sheets is safe, because each sheet is processed independently. One call with many formulations is the fastest and safest way to load a sheet; never split a bulk load across concurrent calls to the same sheet.
Example
from albert.resources.sheets import Component, FormulationSpec
columns = sheet.add_formulations(
formulations=[
FormulationSpec(
name="Formulation A",
components=[
Component(inventory_id="INVA9999999", amount=80.0),
Component(inventory_id="INVA9999998", amount=20.0),
],
),
FormulationSpec(
name="Formulation B",
components=[
Component(inventory_id="INVA9999999", amount=60.0),
Component(inventory_id="INVA9999997", amount=40.0),
],
),
]
)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
formulations
|
list[FormulationSpec]
|
The formulations to build, each pairing a column name with its components. |
required |
enforce_order
|
bool
|
When True, each formulation's ingredient rows follow its component
order on the sheet: existing rows are reused where their position
allows, and new rows (including duplicates of an ingredient already
on the sheet) are added where it does not, matching
|
False
|
clear
|
bool
|
When True (default), an entry whose name matches an existing column
empties and rebuilds that column rather than adding a new one,
matching
|
True
|
Returns:
| Type | Description |
|---|---|
list[Column]
|
The formulation columns created or updated, in the order requested. |
Raises:
| Type | Description |
|---|---|
AlbertPartialError
|
If some ingredient amounts or Total cells could not be written. When ingredient amounts fail, reused columns are restored to their previous contents; read the sheet again and retry. |
Source code in src/albert/resources/sheets.py
1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 | |
add_components_to_formulation
add_components_to_formulation(
*,
formulation_name: str | None = None,
column_id: str | None = None,
inventory_id: InventoryId | None = None,
components: list[Component],
enforce_order: bool = False,
) -> Column
Add components to an existing formulation column without clearing other cells.
Exactly one of column_id, inventory_id, or formulation_name must be provided.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
formulation_name
|
str
|
The name of the formulation column. |
None
|
column_id
|
str
|
The column ID of the formulation column. |
None
|
inventory_id
|
str
|
The inventory ID of the formulation column. |
None
|
components
|
list[Component]
|
The components to append. |
required |
enforce_order
|
bool
|
When True, rows are inserted in the order of |
False
|
Returns:
| Type | Description |
|---|---|
Column
|
The updated formulation column. |
Raises:
| Type | Description |
|---|---|
AlbertPartialError
|
If some component amounts could not be written. The column may be incomplete; read the sheet again and retry. |
Source code in src/albert/resources/sheets.py
1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 | |
add_formulation_columns
add_formulation_columns(
*,
formulation_names: list[str],
starting_position: dict | None = None,
) -> list[Column]
Add one or more empty formulation columns to this sheet.
Creates the formulation columns without populating any ingredient amounts.
To build a formulation and fill in its components in one step, use
add_formulation instead.
The platform recommends at most 100 columns per sheet for performance; the limit is not enforced. Duplicate names can be rejected by the platform, so keep names unique within a sheet.
Concurrent use
Do not run this method concurrently with other writes to the same sheet, whether from threads, processes, or separate machines. The platform coordinates each sheet's structure through shared records that reject simultaneous updates, so concurrent writers to one sheet can fail partway, sometimes with errors that incorrectly report duplicate names. Concurrent use across different sheets is safe, because each sheet is processed independently.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
formulation_names
|
list[str]
|
The names of the formulation columns to add, used as column headers. |
required |
starting_position
|
dict
|
Where to insert the new columns, as a dict with |
None
|
Returns:
| Type | Description |
|---|---|
list[Column]
|
The created formulation columns, in the order requested. |
Source code in src/albert/resources/sheets.py
2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 | |
add_blank_row
add_blank_row(
*,
row_name: str,
design: DesignType = PRODUCTS,
position: dict | None = None,
)
Add a blank (BLK) row to a Design section of this sheet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
row_name
|
str
|
The display name of the new row. |
required |
design
|
DesignType
|
Which Design section to add the row to. Default is |
PRODUCTS
|
position
|
dict
|
Where to insert the row, as a dict with |
None
|
Returns:
| Type | Description |
|---|---|
Row
|
The created row. |
Raises:
| Type | Description |
|---|---|
AlbertException
|
If |
Source code in src/albert/resources/sheets.py
2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 | |
add_blank_rows
add_blank_rows(
*,
row_names: list[str],
design: DesignType = PRODUCTS,
position: dict | None = None,
) -> list[Row]
Add multiple blank (BLK) rows to a Design section of this sheet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
row_names
|
list[str]
|
The display names of the new rows. Rows are created in the order given. |
required |
design
|
DesignType
|
Which Design section to add the rows to. Default is
|
PRODUCTS
|
position
|
dict
|
Where to insert the rows, as a dict with |
None
|
Returns:
| Type | Description |
|---|---|
list[Row]
|
The created rows, in the order requested. |
Raises:
| Type | Description |
|---|---|
AlbertException
|
If |
Source code in src/albert/resources/sheets.py
2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 | |
add_inventory_row
add_inventory_row(
*,
inventory_id: str,
position: dict | None = None,
section_id: str | None = None,
)
Add an ingredient (inventory, raw material) row to the Product Design.
The row represents an inventory item that can then carry amounts in each
formulation column. The INV prefix is added to inventory_id if absent.
Pass section_id to add the row at the end of an existing section (row
group), for example to fill a grouped template.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inventory_id
|
str
|
The inventory ID of the item to add as a row (format |
required |
position
|
dict
|
Where to insert the row, as a dict with |
None
|
section_id
|
str
|
The header row ID of an existing section to add the row to (the |
None
|
Returns:
| Type | Description |
|---|---|
Row
|
The created inventory row. |
Raises:
| Type | Description |
|---|---|
AlbertException
|
If both |
Source code in src/albert/resources/sheets.py
2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 | |
add_inventory_rows
add_inventory_rows(
*,
inventory_ids: list[str],
position: dict | None = None,
section_id: str | None = None,
) -> list[Row]
Add multiple ingredient (inventory, raw material) rows to the Product Design.
The rows represent inventory items that can then carry amounts in each
formulation column. The INV prefix is added to each inventory_id
if absent. All rows in the list are placed relative to the same
reference row, or together at the end of the section given by
section_id.
To build a formulation in a grouped template, add each ingredient to its
section first, then call
add_formulation with the
default enforce_order=False, which reuses those rows.
Concurrent use
Do not run this method concurrently with other writes to the same sheet, whether from threads, processes, or separate machines. The platform coordinates each sheet's structure through shared records that reject simultaneous updates, so concurrent writers to one sheet can fail partway, sometimes with errors that incorrectly report duplicate names. Concurrent use across different sheets is safe, because each sheet is processed independently.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inventory_ids
|
list[str]
|
The inventory IDs of the items to add as rows (format |
required |
position
|
dict
|
Where to insert the rows, as a dict with |
None
|
section_id
|
str
|
The header row ID of an existing section to add the rows to (the
|
None
|
Returns:
| Type | Description |
|---|---|
list[Row]
|
The created inventory rows, in the order requested. |
Raises:
| Type | Description |
|---|---|
AlbertException
|
If both |
Source code in src/albert/resources/sheets.py
2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 | |
add_lookup_row
add_lookup_row(
*,
name: str,
design: DesignType | str | None = APPS,
reference_id: str = "ROW1",
position: RowPosition = ABOVE,
) -> Row
Add a lookup (LKP) row to a design.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The display name of the new row. |
required |
design
|
DesignType or str
|
Which design to add the row to. Default is |
APPS
|
reference_id
|
str
|
The row ID to insert relative to. Defaults to |
'ROW1'
|
position
|
RowPosition
|
Whether to insert |
ABOVE
|
Returns:
| Type | Description |
|---|---|
Row
|
The created row. |
Source code in src/albert/resources/sheets.py
add_app_row
add_app_row(
*,
app_id: str,
name: str,
config: RowConfig | None = None,
design: DesignType | str | None = APPS,
reference_id: str = "ROW1",
position: RowPosition = ABOVE,
) -> Row
Add an application (APP) row to a design.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_id
|
str
|
The ID of the application. The |
required |
name
|
str
|
The display name of the row. |
required |
config
|
RowConfig
|
Row configuration ( |
None
|
design
|
DesignType or str
|
Which design to add the row to. Default is |
APPS
|
reference_id
|
str
|
The row ID to insert relative to. Defaults to |
'ROW1'
|
position
|
RowPosition
|
Whether to insert |
ABOVE
|
Returns:
| Type | Description |
|---|---|
Row
|
The created row. |
Source code in src/albert/resources/sheets.py
2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 | |
get_app_rows
Get the app rows in this sheet's Apps section, with their computed values.
Each AppRow carries one
AppRowValue per column, pairing the
computed value with the calculation that produced it. Rows are
returned in grid order.
Example
Returns:
| Type | Description |
|---|---|
list[AppRow]
|
The app rows of the sheet, in grid order. |
Source code in src/albert/resources/sheets.py
get_calculations
get_calculations() -> SheetCalculations
Get the ingredient bases and calculated properties on this sheet.
Lists the worksheet calculations the sheet shows, as in its Manage Worksheet
panel: each ingredient basis and calculated property by attribute ID and display
name, plus the attributes the sheet uses. Look up a formula's expression on its
attribute's formula_metadata
by display name.
Example
Returns:
| Type | Description |
|---|---|
SheetCalculations
|
The sheet's ingredient bases, calculated properties and attributes. |
Source code in src/albert/resources/sheets.py
add_calculation
add_calculation(
*, attribute_id: AttributeId, display_name: str
) -> SheetCalculations
Add an ingredient basis or calculated property to this sheet.
Puts one of an attribute's formulas
(FormulaMetadata) on the sheet,
as the Manage Worksheet panel does. An ingredient basis adds a column under every
formula column; a calculated property adds a row to the Calculated Properties
group.
Whatever the formula needs is added with it: a property column for each
attribute it references that the sheet does not use yet, the attribute's
ingredient basis when a calculated property reads ingredient_basis, and a
Function column when it filters by WHERE Function.
The worksheet computes the new values when the sheet is next opened in Albert; until then the new cells are empty. Adding a formula the sheet already has changes nothing, and running the method again finishes a change that stopped partway. Edits made at the same time in the Manage Worksheet panel can overwrite each other.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
attribute_id
|
str
|
The ID of the attribute that defines the formula (format |
required |
display_name
|
str
|
The formula's display name on the attribute. |
required |
Returns:
| Type | Description |
|---|---|
SheetCalculations
|
The sheet's calculations after the change. |
Raises:
| Type | Description |
|---|---|
AlbertException
|
If the attribute has no formula with that name, the sheet already uses another ingredient basis of the attribute, another attribute's calculated property on the sheet has the same name, a calculated property reads an ingredient basis its attribute does not define, the formula references an attribute that does not exist, or the sheet would use more than 10 attributes. Nothing on the sheet changes. |
Source code in src/albert/resources/sheets.py
3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 | |
remove_calculation
remove_calculation(
*, attribute_id: AttributeId, display_name: str
) -> SheetCalculations
Remove an ingredient basis or calculated property from this sheet.
Takes one of an attribute's formulas off the sheet, as the Manage Worksheet panel
does. Removing an ingredient basis removes its columns. Removing a calculated
property removes its row, and the Calculated Properties group once it is empty.
Values already saved to formulas stay, and so do the property columns and
attributes the formula brought. A removed calculated property's last value stays
in each formula's
calculated_properties
and in its value for the attribute
(get_values),
so both still return a value for a calculated property no longer on the sheet.
Removing a formula the sheet does not have changes nothing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
attribute_id
|
str
|
The ID of the attribute that defines the formula (format |
required |
display_name
|
str
|
The formula's display name on the attribute. |
required |
Returns:
| Type | Description |
|---|---|
SheetCalculations
|
The sheet's calculations after the change. |
Raises:
| Type | Description |
|---|---|
AlbertException
|
If a calculated property on the sheet uses the ingredient basis being removed. Remove the calculated property first. |
Source code in src/albert/resources/sheets.py
3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 | |
add_parameter_group_row
add_parameter_group_row(
*,
parameter_group_id: ParameterGroupId,
reference_id: str | None = None,
position: RowPosition = ABOVE,
) -> Row
Add a parameter group (PRG) row to this sheet's Process Design.
The platform expands the PRG into one PRM row per parameter in the group.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parameter_group_id
|
ParameterGroupId
|
The Parameter Group ID to add (format |
required |
reference_id
|
str
|
The row ID to insert relative to. Defaults to the first Process Design
row when one exists. Omit (or leave |
None
|
position
|
RowPosition
|
Whether to insert |
ABOVE
|
Returns:
| Type | Description |
|---|---|
Row
|
The created PRG row. |
Raises:
| Type | Description |
|---|---|
AlbertException
|
If the sheet has no Process Design section, or the response has no rows. |
Source code in src/albert/resources/sheets.py
3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 | |
add_task_row
add_task_row(
*,
task_id: TaskId,
name: str | None = None,
reference_id: str | None = None,
position: RowPosition = ABOVE,
) -> Row
Link a task into this sheet's Results section as a task (TAS) row.
Creating a task does not place it in the worksheet's Results grid: the platform only adds the TAS row when the task is created from the worksheet UI. Call this after creating a property task programmatically so the task (and its results) shows up in the sheet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
TaskId
|
The Task ID to link (format |
required |
name
|
str
|
The display name of the row. Defaults to the task's current name, read from the platform. |
None
|
reference_id
|
str
|
The row ID to insert relative to. Defaults to the first Results
row when one exists. Omit (or leave |
None
|
position
|
RowPosition
|
Whether to insert |
ABOVE
|
Returns:
| Type | Description |
|---|---|
Row
|
The created task row. |
Raises:
| Type | Description |
|---|---|
AlbertException
|
If the sheet has no Results section, or the response has no rows. |
Source code in src/albert/resources/sheets.py
3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 | |
update_cells
Write changed cells back to the sheet.
Compares each cell against the current grid and sends only the changed
attributes (value, calculation, formatting, bounds). Higher-level methods
such as add_formulation and recolor_cells call this
for you; use it directly when editing cells obtained from the grid.
All changes across all designs are computed and validated before
anything is written, so one malformed calculation means nothing is
written; the ValueError names the offending cell's row and column.
Edits of any size are accepted; large edits are split to stay within
platform limits. If the same sheet is being written elsewhere
concurrently, some edits can fail and come back in failed; read the
sheet again and retry those.
The worksheet computes the values in a calculated property row and an
ingredient basis column, so a value, calculation or bound written there would be
overwritten the next time the sheet calculates and would leave the copies stored
with the formula out of date. Such cells are not written and come back unchanged
in failed, and a UserWarning says how many; unlike cells that fail from
concurrent writes, retrying will not write them. Formatting changes on them, and
all other cells, are written as usual.
Writing list-backed cell values. Cells in a Function (FNC) column or
an enum lookup column store list item references. Set Cell.value to the
list item id ("LST..."), not the display name. Resolve Function tags with
get_all and
list_type="inventoryFunction". Quoted names in WHERE Function = "..."
belong only in calculation strings, not in value.
Writing calculations. Totals and row arithmetic reference grid
coordinates and start with =, e.g. "=COL5ROW12+COL6ROW12".
Calculated properties and ingredient bases instead use the ingredient
expression language:
- Variables:
wt%(the ingredient's weight percent),parts_mass(the ingredient's amount),Function(the ingredient's Function tag; usable only inWHEREfilters), andingredient_basis(the per-ingredient result of a linked basis, usable inside aggregations, e.g.sum(ingredient_basis WHERE Function = "Resin"); either casing of the variable compiles, but the platform's authored form is lowercase). Beyond the built-ins, any property attribute of the ingredient works in brackets, by name or ID, e.g.[Solid %]or[ATR66]; find them throughAttributeCollection(client.attributes). Combine variables with+ - * /, parentheses, and numbers, e.g.wt% * [Solid %] / 100. sum(expr)sums an expression over every ingredient.sum(expr WHERE Function = "Core")sums over only the ingredients whose Function tag matches.ORadds more values of the same key:sum(wt% WHERE Function = "Core" OR Function = "Shell").ANDis not supported (an ingredient carries one Function value), values must be quoted, and oneWHEREfilter reads one key. A text property attribute in brackets can filter instead ofFunction, e.g.sum(parts_mass WHERE [Resin Type] = "Epoxy"). Filter keys are case-sensitive:Functionis the exact spelling, and another casing compiles but silently matches nothing.harmonicMean(weight, attr)is the weighted harmonic mean across all ingredients, e.g.harmonicMean(wt%, [Density]).WHEREfilters are supported only insidesum(...), not inharmonicMean(...).- Aggregations are spelled in lowercase:
SUM(...)orSum(...)over ingredient variables does not compile. Plain column totals such as=SUM(COL5:COL9)are a different formula language and are unaffected.
Choosing between an ingredient basis and a calculated property: an
ingredient basis computes one value per ingredient and is the only form
that supports back-solving (entering a target result and letting the
platform solve for the ingredient amount). A calculated property
computes a single aggregate result per formulation as a read-only
output and cannot be back-solved; the platform refuses a back-solve
configuration on a calculated property (the SDK does not check this,
since back-solve configuration has no SDK surface), so when
back-solving is needed, model the value as an ingredient basis.
Back-solving supports plain per-ingredient expressions and share-of-sum
shapes such as wt% / sum(wt% WHERE Function = "Resin") * 100
(parts per hundred resin); other aggregations cannot be back-solved.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cells
|
list[Cell]
|
The cells to update. Typically copies of existing cells with modified values or formatting. |
required |
refresh
|
bool
|
When True (default), the sheet's in-memory view is discarded after the
write, so the next read loads the latest state, including anything the
platform computed as a side effect of the write (calculated cells,
synced rows, Total formatting). When False, the written cells are
applied to the in-memory view instead and no reload happens; this is
intended for long bulk operations that write many times in a row and
would be slowed down by reloading between writes. Bulk methods such as
|
True
|
Returns:
| Type | Description |
|---|---|
tuple[list[Cell], list[Cell]]
|
A |
Source code in src/albert/resources/sheets.py
3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 | |
add_blank_column
add_blank_column(
*,
name: str,
reference_id: str | None = None,
position: ColumnPosition = RIGHT_OF,
) -> Column
Add a blank (BLK) column to this sheet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The display name of the new column. |
required |
reference_id
|
str
|
The column ID to insert relative to. Defaults to the last column in the sheet. |
None
|
position
|
ColumnPosition
|
Whether to insert |
RIGHT_OF
|
Returns:
| Type | Description |
|---|---|
Column
|
The created column. |
Source code in src/albert/resources/sheets.py
add_columns
add_columns(
*,
names: list[str],
type: Literal["BLK", "LKP", "FNC"] = "BLK",
reference_id: str | None = None,
position: ColumnPosition = RIGHT_OF,
) -> list[Column]
Add multiple columns of one type in a single call.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
names
|
list[str]
|
The display names of the new columns, in left-to-right order. |
required |
type
|
str
|
The column type: |
'BLK'
|
reference_id
|
str
|
The column ID to insert relative to. Defaults to the last column in the sheet. |
None
|
position
|
ColumnPosition
|
Whether to insert |
RIGHT_OF
|
Returns:
| Type | Description |
|---|---|
list[Column]
|
The created columns, in the order requested. |
Source code in src/albert/resources/sheets.py
4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 | |
add_lookup_column
add_lookup_column(
*,
name: str,
reference_id: str | None = None,
position: ColumnPosition = RIGHT_OF,
) -> Column
Add a lookup (LKP) column to this sheet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The display name of the new column. |
required |
reference_id
|
str
|
The column ID to insert relative to. Defaults to the last column in the sheet. |
None
|
position
|
ColumnPosition
|
Whether to insert |
RIGHT_OF
|
Returns:
| Type | Description |
|---|---|
Column
|
The created column. |
Source code in src/albert/resources/sheets.py
add_function_column
add_function_column(
*,
name: str,
reference_id: str | None = None,
position: ColumnPosition = RIGHT_OF,
) -> Column
Add a function (FNC) column to this sheet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The display name of the new column. |
required |
reference_id
|
str
|
The column ID to insert relative to. Defaults to the last column in the sheet. |
None
|
position
|
ColumnPosition
|
Whether to insert |
RIGHT_OF
|
Returns:
| Type | Description |
|---|---|
Column
|
The created column. |
Source code in src/albert/resources/sheets.py
add_property_column
add_property_column(
*,
name: str,
attribute_id: str,
data_column_id: DataColumnId | None = None,
data_column_name: str | None = None,
reference_id: str | None = None,
position: ColumnPosition = RIGHT_OF,
) -> Column
Add a property/result (RSL) column to this sheet.
Exactly one of data_column_id or data_column_name must be provided;
the other is fetched automatically.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The display name of the new column. |
required |
attribute_id
|
str
|
The ID of the attribute (e.g. |
required |
data_column_id
|
DataColumnId
|
The data column ID (e.g. |
None
|
data_column_name
|
str
|
The data column name. Fetched from the API if omitted. |
None
|
reference_id
|
str
|
The column ID to insert relative to. Defaults to the last column in the sheet. |
None
|
position
|
ColumnPosition
|
Whether to insert |
RIGHT_OF
|
Returns:
| Type | Description |
|---|---|
Column
|
The created column. |
Source code in src/albert/resources/sheets.py
4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 | |
reorder_columns
Reorder all columns on this sheet from left to right.
Provide every column ID on the sheet exactly once, in the desired display order. The first ID is placed at the left edge; the last at the right. Ingredient basis columns always stay with their formulation column: they may be listed or left out, and where they are listed is ignored.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
column_ids
|
list[str]
|
Column IDs in the desired left-to-right order. Must include every column on the sheet exactly once; ingredient basis columns are optional. |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
Raises:
| Type | Description |
|---|---|
AlbertException
|
If |
Source code in src/albert/resources/sheets.py
4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 | |
pin_columns
Pin one or more columns to the left or right edge of the sheet.
Pinning a formulation column pins its ingredient basis columns
(INGREDIENT_BASIS) with it,
as in Albert. An ingredient basis column cannot be pinned on its own: its ID is
skipped with a UserWarning and the other columns are still pinned. To pin an
ingredient basis column, pin its formulation column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
col_ids
|
list[str]
|
The column IDs to pin. Ingredient basis column IDs are skipped. |
required |
side
|
'left' or 'right'
|
Which edge to pin to. |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
Warns:
| Type | Description |
|---|---|
UserWarning
|
If |
Source code in src/albert/resources/sheets.py
unpin_columns
Unpin one or more columns.
Unpinning a formulation column unpins its ingredient basis columns
(INGREDIENT_BASIS) with it,
as in Albert. An ingredient basis column cannot be unpinned on its own: its ID is
skipped with a UserWarning and the other columns are still unpinned. To unpin
an ingredient basis column, unpin its formulation column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
col_ids
|
list[str]
|
The column IDs to unpin. Ingredient basis column IDs are skipped. |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
Warns:
| Type | Description |
|---|---|
UserWarning
|
If |
Source code in src/albert/resources/sheets.py
set_columns_width
Set the display width of one or more columns.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
col_ids
|
list[str]
|
Column IDs to update. |
required |
width
|
str
|
Width value, e.g. |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in src/albert/resources/sheets.py
hide_column
hide_column(*, col_id: str) -> None
Hide a column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
col_id
|
str
|
The column ID to hide. |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in src/albert/resources/sheets.py
show_column
show_column(*, col_id: str) -> None
Show a hidden column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
col_id
|
str
|
The column ID to show. |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in src/albert/resources/sheets.py
hide_columns
Hide multiple columns in a single call.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
column_ids
|
list[str]
|
The column IDs to hide. |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in src/albert/resources/sheets.py
show_columns
Show multiple hidden columns in a single call.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
column_ids
|
list[str]
|
The column IDs to show. |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in src/albert/resources/sheets.py
rename_columns
Rename multiple columns in a single call.
Set name on each column to its new name before calling.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
columns
|
list[Column]
|
The columns to rename, each carrying its new |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in src/albert/resources/sheets.py
delete_column
delete_column(*, column_id: str) -> None
Delete a column from this sheet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
column_id
|
str
|
The ID of the column to delete. |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in src/albert/resources/sheets.py
delete_columns
Delete multiple columns from this sheet in a single call.
Note: The platform only allows deleting blank (BLK) columns.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
column_ids
|
list[str]
|
The IDs of the columns to delete. Only blank (BLK) columns can be deleted. |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in src/albert/resources/sheets.py
delete_row
Delete a row from a Design section of this sheet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
row_id
|
str
|
The ID of the row to delete. |
required |
design_id
|
str
|
The ID of the Design (section) the row belongs to. |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in src/albert/resources/sheets.py
delete_rows
Delete multiple rows from a Design section of this sheet in a single call.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
row_ids
|
list[str]
|
The IDs of the rows to delete. |
required |
design_id
|
str
|
The ID of the Design (section) the rows belong to. |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in src/albert/resources/sheets.py
move_rows
move_rows(
*,
row_ids: list[str],
reference_id: str,
design_id: str,
position: RowPosition = ABOVE,
) -> None
Move (reorder) one or more rows within a Design section of this sheet.
The rows keep their given relative order and are placed together above or below the reference row. Moving rows next to a row inside a section (row group) moves them into that section.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
row_ids
|
list[str]
|
The IDs of the rows to move. The rows are moved together in their given order. |
required |
reference_id
|
str
|
The ID of the row to move relative to. Must not be one of |
required |
design_id
|
str
|
The ID of the Design (section) the rows belong to. |
required |
position
|
RowPosition
|
Whether to place the rows |
ABOVE
|
Returns:
| Type | Description |
|---|---|
None
|
|
Raises:
| Type | Description |
|---|---|
AlbertException
|
If |
Source code in src/albert/resources/sheets.py
get_column
get_column(
*,
column_id: str | None = None,
inventory_id: InventoryId | None = None,
column_name: str | None = None,
) -> Column
Retrieve a Column by its column ID, underlying inventory ID, or header name.
Provide at least one of the three identifiers; the match must be unique.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
column_id
|
str
|
The sheet column ID to match (e.g. |
None
|
inventory_id
|
str
|
The underlying inventory ID to match (e.g. |
None
|
column_name
|
str
|
The human-readable header name of the column (e.g. |
None
|
Returns:
| Type | Description |
|---|---|
Column
|
The matching column. |
Raises:
| Type | Description |
|---|---|
AlbertException
|
If no identifier is provided, no matching column is found, or multiple columns match. |
Source code in src/albert/resources/sheets.py
4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 | |
lock_column
lock_column(
*,
column_id: str | None = None,
inventory_id: InventoryId | None = None,
column_name: str | None = None,
locked: bool = True,
) -> Column
Lock or unlock a column in the sheet.
The column can be specified by its sheet column ID (e.g. "COL5"),
by the underlying inventory identifier of a formulation/product, or by
the displayed header name. By default the column will be locked; pass
locked=False to unlock it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
column_id
|
str | None
|
The sheet column ID to match. |
None
|
inventory_id
|
str | None
|
The inventory identifier of the formulation or product to match. |
None
|
column_name
|
str | None
|
The displayed header name of the column. |
None
|
locked
|
bool
|
Whether to lock ( |
True
|
Returns:
| Type | Description |
|---|---|
Column
|
The column that was updated. |
Source code in src/albert/resources/sheets.py
5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 | |
lock_columns
Lock or unlock multiple columns in a single call.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
column_ids
|
list[str]
|
The column IDs to lock or unlock. |
required |
locked
|
bool
|
Whether to lock ( |
True
|
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in src/albert/resources/sheets.py
Column
Bases: BaseSessionResource
A column in a Sheet.
A Column is a live grid element that carries the session. A column can be a
formulation (the most common case for the SDK), a lookup column that displays
an inventory attribute, an ingredient name, or another type given by
CellType. Its cells are read through cells and written back
with update_cells.
Methods:
| Name | Description |
|---|---|
rename |
Rename the column. |
recolor_cells |
Apply a background color to every cell in the column. |
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"
},
"CellType": {
"description": "The kind of content a Cell, Column, or Row holds.\n\nCells, Columns, and Rows all carry a type drawn from this enum, which\ndetermines how the platform interprets their contents. The values most\nrelevant when building formulations are ``INVENTORY`` (an ingredient amount),\n``TOTAL`` (a computed total row), ``FORMULA`` and ``FOR`` (formulation\ncolumns), ``LKP`` (a lookup that displays an inventory attribute), and\n``BLANK`` (an empty cell). ``CALCULATED_PROPERTY`` marks a calculated property\nrow and ``INGREDIENT_BASIS`` an ingredient basis column; the worksheet computes\ntheir values, so they are read-only (see\n[`update_cells`][albert.resources.sheets.Sheet.update_cells]); list them with\n[`get_calculations`][albert.resources.sheets.Sheet.get_calculations]. The remaining\nmembers correspond to specialized grid content such as tags, prices, tasks,\nresults, and apps.",
"enum": [
"INV",
"APP",
"BLK",
"Formula",
"TAG",
"PRC",
"PDC",
"BAT",
"TOT",
"TAS",
"DEF",
"LKP",
"FOR",
"EXTINV",
"BTI",
"PRM",
"PRG",
"RSL",
"FNC",
"WFL",
"DAC",
"INT",
"DAT",
"NDR",
"PIC",
"CPR",
"IBS"
],
"title": "CellType",
"type": "string"
},
"Design": {
"description": "One section of a Sheet, backing the grid for a single [`DesignType`][albert.resources.sheets.DesignType].\n\nA Sheet is made up of stacked sections (Product Design, Process Design,\nResults, and Apps) and each section is a Design. Designs are largely an\ninternal detail: most work is done through the parent [`Sheet`][albert.resources.sheets.Sheet], which\nexposes its Designs as [`product_design`][albert.resources.sheets.Sheet.product_design],\n[`result_design`][albert.resources.sheets.Sheet.result_design], [`app_design`][albert.resources.sheets.Sheet.app_design], and\n[`process_design`][albert.resources.sheets.Sheet.process_design]. A Design is a live grid element that carries the\nsession and lazily loads its rows, columns, and grid on first access.\nMethods\n-------\ngroup_rows(name, child_row_ids, ...) -> RowGroup\n Create a new row group (section) within this design.\nget_groups(refresh=False) -> list[RowGroup]\n Get all row groups in this design, including sections nested inside other\n sections.",
"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."
},
"state": {
"anyOf": [
{
"$ref": "#/$defs/DesignState"
},
{
"type": "null"
}
],
"default": null,
"description": "The display state of the design. Optional. Default is None."
},
"albertId": {
"description": "The Albert ID of the design.",
"title": "Albertid",
"type": "string"
},
"designType": {
"anyOf": [
{
"$ref": "#/$defs/DesignType"
},
{
"type": "string"
}
],
"description": "The section of the Sheet this design backs. See [`DesignType`][albert.resources.sheets.DesignType]. Unknown legacy/tenant values parse as plain strings.",
"title": "Designtype"
}
},
"required": [
"albertId",
"designType"
],
"title": "Design",
"type": "object"
},
"DesignState": {
"description": "The display state of a Design section within a Sheet.",
"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."
},
"collapsed": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": false,
"description": "Whether the Design section is collapsed in the Sheet view. Default is False.",
"title": "Collapsed"
}
},
"title": "DesignState",
"type": "object"
},
"DesignType": {
"description": "The section of a Sheet that a Design represents.\n\nA Sheet is organized into stacked sections, each backed by a Design\n([`Design`][albert.resources.sheets.Design]). The type identifies which section:\n\n- ``PRODUCTS``: Product Design, where formulations are built.\n- ``PROCESS``: Process Design.\n- ``RESULTS``: Results, holding Property Tasks and their data.\n- ``APPS``: Apps, holding insights, reporting, and notes.",
"enum": [
"apps",
"products",
"results",
"process",
"reagents"
],
"title": "DesignType",
"type": "string"
},
"Sheet": {
"description": "An interactive grid within a Worksheet where formulations are built.\n\nA Sheet is one grid inside a Worksheet ([`Worksheet`][albert.resources.worksheets.Worksheet]).\nIt is organized into stacked sections, each a [`Design`][albert.resources.sheets.Design]: Product Design\n(where formulations are built), Process Design, Results (Property Tasks and\ntheir data), and Apps (insights and notes). Access those sections through\n[`product_design`][albert.resources.sheets.Sheet.product_design], [`process_design`][albert.resources.sheets.Sheet.process_design], [`result_design`][albert.resources.sheets.Sheet.result_design], and\n[`app_design`][albert.resources.sheets.Sheet.app_design].\n\nA Sheet Column can be a formulation (the most common case for the SDK), a\nlookup column that displays an inventory attribute, or an ingredient name.\nRows typically represent ingredients (inventory items) and their amounts.\nAdding a formulation to a Sheet is what registers a Formula inventory item.\n\nThe Sheet is a live grid element that carries the session; its cells, columns,\nand rows are themselves interactive. Retrieve a Sheet from a Worksheet's\n[`sheets`][albert.resources.worksheets.Worksheet.sheets], then edit it in place\nwith the methods below.\n\n!!! example\n ```python\n from albert import Albert\n client = Albert()\n worksheet = client.worksheets.get_by_project_id(project_id=\"PROA9999999\")\n sheet = worksheet.sheets[0]\n print(sheet.grid)\n ```\nMethods\n-------\nrename(new_name) -> Sheet\n Rename the sheet.\nadd_formulation(formulation_name, components, ...) -> Column\n Build a formulation column from a list of components (registers a Formula).\nadd_formulations(formulations) -> list[Column]\n Build multiple formulations in one call, sharing ingredient rows.\nadd_components_to_formulation(components, ...) -> Column\n Add components to an existing formulation column.\nadd_formulation_columns(formulation_names, ...) -> list[Column]\n Add one or more empty formulation columns.\nadd_inventory_row(inventory_id, ...) -> Row\n Add an ingredient (inventory) row, optionally into a section.\nadd_inventory_rows(inventory_ids, ...) -> list[Row]\n Add multiple ingredient (inventory) rows in one call, optionally into a section.\nadd_blank_row(row_name, ...) -> Row\n Add a blank row.\nadd_blank_rows(row_names, ...) -> list[Row]\n Add multiple blank rows in one call.\nadd_lookup_row(name, ...) -> Row\n Add a lookup row.\nadd_app_row(app_id, name, ...) -> Row\n Add an application row.\nget_app_rows() -> list[AppRow]\n Get the app rows of the Apps section, with their computed values.\nget_calculations() -> SheetCalculations\n Get the ingredient bases and calculated properties on the sheet (Manage Worksheet).\nadd_calculation(attribute_id, display_name) -> SheetCalculations\n Add an ingredient basis or calculated property to the sheet.\nremove_calculation(attribute_id, display_name) -> SheetCalculations\n Remove an ingredient basis or calculated property from the sheet.\nadd_parameter_group_row(parameter_group_id, ...) -> Row\n Add a parameter group (PRG) row to Process Design.\nadd_task_row(task_id, ...) -> Row\n Link a task into the Results section as a task (TAS) row.\nadd_blank_column(name, ...) -> Column\n Add a blank column.\nadd_columns(names, ...) -> list[Column]\n Add multiple columns of one type in one call.\nadd_lookup_column(name, ...) -> Column\n Add a lookup column.\nadd_function_column(name, ...) -> Column\n Add a function column.\nadd_property_column(name, attribute_id, ...) -> Column\n Add a property/result column.\nget_column(...) -> Column\n Retrieve a column by column ID, inventory ID, or name.\nupdate_cells(cells) -> tuple[list[Cell], list[Cell]]\n Write changed cells back to the sheet.\npin_columns(col_ids, side) -> None\n Pin columns to the left or right edge.\nunpin_columns(col_ids) -> None\n Unpin columns.\nlock_column(...) -> Column\n Lock or unlock a column.\nlock_columns(column_ids, locked=True) -> None\n Lock or unlock multiple columns in one call.\nrename_columns(columns) -> None\n Rename multiple columns in one call.\nhide_column(col_id) -> None\n Hide a column.\nhide_columns(column_ids) -> None\n Hide multiple columns in one call.\nshow_column(col_id) -> None\n Show a hidden column.\nshow_columns(column_ids) -> None\n Show multiple hidden columns in one call.\nset_columns_width(col_ids, width) -> None\n Set the display width of columns.\nreorder_columns(column_ids) -> None\n Reorder all columns left to right by column ID.\ndelete_column(column_id) -> None\n Delete a column.\ndelete_columns(column_ids) -> None\n Delete multiple columns in one call.\ndelete_row(row_id, design_id) -> None\n Delete a row.\ndelete_rows(row_ids, design_id) -> None\n Delete multiple rows from a Design section in one call.\nmove_rows(row_ids, reference_id, design_id, ...) -> None\n Move (reorder) rows within a Design section, above or below a reference row.",
"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": {
"description": "The Albert ID of the sheet.",
"title": "Albertid",
"type": "string"
},
"name": {
"description": "The name of the sheet.",
"title": "Name",
"type": "string"
},
"Formulas": {
"description": "References to the formulations present on the sheet.",
"items": {
"$ref": "#/$defs/SheetFormulationRef"
},
"title": "Formulas",
"type": "array"
},
"hidden": {
"description": "Whether the sheet is hidden.",
"title": "Hidden",
"type": "boolean"
},
"isColumnRight": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "When True, copied columns are placed to the right of the source column; when False, to the left.",
"title": "Iscolumnright"
},
"colSizeMode": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Column width sizing mode. Allowed values are ``\"minimum\"`` and ``\"fitToColumn\"``. ``None`` resets to the default grid width.",
"title": "Colsizemode"
},
"Designs": {
"description": "The Designs (sections) of the sheet.",
"items": {
"$ref": "#/$defs/Design"
},
"title": "Designs",
"type": "array"
},
"projectId": {
"description": "The ID of the Project the sheet belongs to (format ``PRO...``).",
"title": "Projectid",
"type": "string"
}
},
"required": [
"albertId",
"name",
"hidden",
"Designs",
"projectId"
],
"title": "Sheet",
"type": "object"
},
"SheetFormulationRef": {
"description": "A reference to a formulation in a sheet",
"properties": {
"id": {
"description": "The Albert ID of the inventory item that is the formulation",
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The name of the formulation",
"title": "Name"
},
"hidden": {
"description": "Whether the formulation is hidden",
"title": "Hidden",
"type": "boolean"
}
},
"required": [
"id",
"hidden"
],
"title": "SheetFormulationRef",
"type": "object"
},
"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"
}
},
"description": "A column in a Sheet.\n\nA Column is a live grid element that carries the session. A column can be a\nformulation (the most common case for the SDK), a lookup column that displays\nan inventory attribute, an ingredient name, or another type given by\n[`CellType`][albert.resources.sheets.CellType]. Its cells are read through [`cells`][albert.resources.sheets.Column.cells] and written back\nwith [`update_cells`][albert.resources.sheets.Sheet.update_cells].\nMethods\n-------\nrename(new_name) -> Column\n Rename the column.\nrecolor_cells(color) -> tuple[list[Cell], list[Cell]]\n Apply a background color to every cell in the column.",
"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."
},
"colId": {
"description": "The ID of the column.",
"title": "Colid",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The header name of the column. Optional. Default is None.",
"title": "Name"
},
"type": {
"anyOf": [
{
"$ref": "#/$defs/CellType"
},
{
"type": "string"
}
],
"description": "The type of the column. Allowed values are the same as for [`CellType`][albert.resources.sheets.CellType].",
"title": "Type"
},
"sheet": {
"$ref": "#/$defs/Sheet",
"description": "The sheet the column belongs to."
},
"inventory_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "For a formulation column, the underlying inventory ID (format ``INV...``). Optional. Default is None.",
"title": "Inventory Id"
},
"attribute_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "For a property/result (``RSL``) column, the ID of the attribute it reads (format ``ATR...``). None for other column types. Read-only.",
"title": "Attribute Id"
},
"locked": {
"default": false,
"description": "Whether the column is locked against edits. Default is False.",
"title": "Locked",
"type": "boolean"
},
"hidden": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether the column is hidden. Optional. Default is None.",
"title": "Hidden"
},
"pinned": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The edge the column is pinned to (``\"left\"`` or ``\"right\"``), or None.",
"title": "Pinned"
},
"column_width": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display width of the column (e.g. ``\"142px\"``), or None.",
"title": "Column Width"
},
"cp_reference_values": {
"anyOf": [
{
"additionalProperties": {
"type": "string"
},
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "For a formulation column, the formula's current value of each calculated property attribute on the sheet, keyed by attribute ID, as text. Compare it with this column's cell in the calculated property row: a difference means the attribute value was changed outside the sheet. None when not available (for example, no value is stored yet), which does not mean the two match. Read-only.",
"title": "Cp Reference Values"
}
},
"required": [
"colId",
"type",
"sheet"
],
"title": "Column",
"type": "object"
}
Fields:
-
status(Status | None) -
created(AuditFields | None) -
updated(AuditFields | None) -
column_id(str) -
name(str | None) -
type(CellType | str) -
sheet(Sheet) -
inventory_id(str | None) -
attribute_id(str | None) -
locked(bool) -
hidden(bool | None) -
pinned(str | None) -
column_width(str | None) -
cp_reference_values(dict[str, str] | None)
Validators:
-
_bind_session -
_none_to_false→locked
inventory_id
inventory_id: str | None = None
For a formulation column, the underlying inventory ID (format INV...). Optional. Default is None.
attribute_id
attribute_id: str | None = None
For a property/result (RSL) column, the ID of the attribute it reads (format ATR...). None for other column types. Read-only.
column_width
column_width: str | None = None
The display width of the column (e.g. "142px"), or None.
cp_reference_values
For a formulation column, the formula's current value of each calculated property attribute on the sheet, keyed by attribute ID, as text. Compare it with this column's cell in the calculated property row: a difference means the attribute value was changed outside the sheet. None when not available (for example, no value is stored yet), which does not mean the two match. Read-only.
cells
This column's cells as a pandas Series keyed by row id.
Empty cells may appear as NaN floats (pandas padding); check
isinstance(value, Cell) before using a value.
rename
Rename this column.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
new_name
|
str
|
The new header name for the column. |
required |
Returns:
| Type | Description |
|---|---|
Column
|
This column, with its name updated. |
Source code in src/albert/resources/sheets.py
recolor_cells
recolor_cells(color: CellColor)
Apply a background color to every cell in this column.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
color
|
CellColor
|
The background color to apply. |
required |
Returns:
| Type | Description |
|---|---|
tuple[list[Cell], list[Cell]]
|
A |
Source code in src/albert/resources/sheets.py
Row
Bases: BaseSessionResource
A row in a Sheet.
A Row is a live grid element that carries the session. Rows typically
represent ingredients (inventory items) and their amounts, but a row can also
be a total, lookup, app, or blank row per its type. Each row belongs
to a specific Design section of the sheet. Its cells are read
through cells and written back with update_cells.
Methods:
| Name | Description |
|---|---|
recolor_cells |
Apply a background color to every cell in the row. |
rename |
Rename the row. |
replace_inventory |
Replace (swap) the inventory item on the row. |
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"
},
"CellType": {
"description": "The kind of content a Cell, Column, or Row holds.\n\nCells, Columns, and Rows all carry a type drawn from this enum, which\ndetermines how the platform interprets their contents. The values most\nrelevant when building formulations are ``INVENTORY`` (an ingredient amount),\n``TOTAL`` (a computed total row), ``FORMULA`` and ``FOR`` (formulation\ncolumns), ``LKP`` (a lookup that displays an inventory attribute), and\n``BLANK`` (an empty cell). ``CALCULATED_PROPERTY`` marks a calculated property\nrow and ``INGREDIENT_BASIS`` an ingredient basis column; the worksheet computes\ntheir values, so they are read-only (see\n[`update_cells`][albert.resources.sheets.Sheet.update_cells]); list them with\n[`get_calculations`][albert.resources.sheets.Sheet.get_calculations]. The remaining\nmembers correspond to specialized grid content such as tags, prices, tasks,\nresults, and apps.",
"enum": [
"INV",
"APP",
"BLK",
"Formula",
"TAG",
"PRC",
"PDC",
"BAT",
"TOT",
"TAS",
"DEF",
"LKP",
"FOR",
"EXTINV",
"BTI",
"PRM",
"PRG",
"RSL",
"FNC",
"WFL",
"DAC",
"INT",
"DAT",
"NDR",
"PIC",
"CPR",
"IBS"
],
"title": "CellType",
"type": "string"
},
"Design": {
"description": "One section of a Sheet, backing the grid for a single [`DesignType`][albert.resources.sheets.DesignType].\n\nA Sheet is made up of stacked sections (Product Design, Process Design,\nResults, and Apps) and each section is a Design. Designs are largely an\ninternal detail: most work is done through the parent [`Sheet`][albert.resources.sheets.Sheet], which\nexposes its Designs as [`product_design`][albert.resources.sheets.Sheet.product_design],\n[`result_design`][albert.resources.sheets.Sheet.result_design], [`app_design`][albert.resources.sheets.Sheet.app_design], and\n[`process_design`][albert.resources.sheets.Sheet.process_design]. A Design is a live grid element that carries the\nsession and lazily loads its rows, columns, and grid on first access.\nMethods\n-------\ngroup_rows(name, child_row_ids, ...) -> RowGroup\n Create a new row group (section) within this design.\nget_groups(refresh=False) -> list[RowGroup]\n Get all row groups in this design, including sections nested inside other\n sections.",
"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."
},
"state": {
"anyOf": [
{
"$ref": "#/$defs/DesignState"
},
{
"type": "null"
}
],
"default": null,
"description": "The display state of the design. Optional. Default is None."
},
"albertId": {
"description": "The Albert ID of the design.",
"title": "Albertid",
"type": "string"
},
"designType": {
"anyOf": [
{
"$ref": "#/$defs/DesignType"
},
{
"type": "string"
}
],
"description": "The section of the Sheet this design backs. See [`DesignType`][albert.resources.sheets.DesignType]. Unknown legacy/tenant values parse as plain strings.",
"title": "Designtype"
}
},
"required": [
"albertId",
"designType"
],
"title": "Design",
"type": "object"
},
"DesignState": {
"description": "The display state of a Design section within a Sheet.",
"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."
},
"collapsed": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": false,
"description": "Whether the Design section is collapsed in the Sheet view. Default is False.",
"title": "Collapsed"
}
},
"title": "DesignState",
"type": "object"
},
"DesignType": {
"description": "The section of a Sheet that a Design represents.\n\nA Sheet is organized into stacked sections, each backed by a Design\n([`Design`][albert.resources.sheets.Design]). The type identifies which section:\n\n- ``PRODUCTS``: Product Design, where formulations are built.\n- ``PROCESS``: Process Design.\n- ``RESULTS``: Results, holding Property Tasks and their data.\n- ``APPS``: Apps, holding insights, reporting, and notes.",
"enum": [
"apps",
"products",
"results",
"process",
"reagents"
],
"title": "DesignType",
"type": "string"
},
"RowConfig": {
"description": "Configuration for an APP or location-type row.",
"properties": {
"option": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Option"
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Value"
}
},
"title": "RowConfig",
"type": "object"
},
"Sheet": {
"description": "An interactive grid within a Worksheet where formulations are built.\n\nA Sheet is one grid inside a Worksheet ([`Worksheet`][albert.resources.worksheets.Worksheet]).\nIt is organized into stacked sections, each a [`Design`][albert.resources.sheets.Design]: Product Design\n(where formulations are built), Process Design, Results (Property Tasks and\ntheir data), and Apps (insights and notes). Access those sections through\n[`product_design`][albert.resources.sheets.Sheet.product_design], [`process_design`][albert.resources.sheets.Sheet.process_design], [`result_design`][albert.resources.sheets.Sheet.result_design], and\n[`app_design`][albert.resources.sheets.Sheet.app_design].\n\nA Sheet Column can be a formulation (the most common case for the SDK), a\nlookup column that displays an inventory attribute, or an ingredient name.\nRows typically represent ingredients (inventory items) and their amounts.\nAdding a formulation to a Sheet is what registers a Formula inventory item.\n\nThe Sheet is a live grid element that carries the session; its cells, columns,\nand rows are themselves interactive. Retrieve a Sheet from a Worksheet's\n[`sheets`][albert.resources.worksheets.Worksheet.sheets], then edit it in place\nwith the methods below.\n\n!!! example\n ```python\n from albert import Albert\n client = Albert()\n worksheet = client.worksheets.get_by_project_id(project_id=\"PROA9999999\")\n sheet = worksheet.sheets[0]\n print(sheet.grid)\n ```\nMethods\n-------\nrename(new_name) -> Sheet\n Rename the sheet.\nadd_formulation(formulation_name, components, ...) -> Column\n Build a formulation column from a list of components (registers a Formula).\nadd_formulations(formulations) -> list[Column]\n Build multiple formulations in one call, sharing ingredient rows.\nadd_components_to_formulation(components, ...) -> Column\n Add components to an existing formulation column.\nadd_formulation_columns(formulation_names, ...) -> list[Column]\n Add one or more empty formulation columns.\nadd_inventory_row(inventory_id, ...) -> Row\n Add an ingredient (inventory) row, optionally into a section.\nadd_inventory_rows(inventory_ids, ...) -> list[Row]\n Add multiple ingredient (inventory) rows in one call, optionally into a section.\nadd_blank_row(row_name, ...) -> Row\n Add a blank row.\nadd_blank_rows(row_names, ...) -> list[Row]\n Add multiple blank rows in one call.\nadd_lookup_row(name, ...) -> Row\n Add a lookup row.\nadd_app_row(app_id, name, ...) -> Row\n Add an application row.\nget_app_rows() -> list[AppRow]\n Get the app rows of the Apps section, with their computed values.\nget_calculations() -> SheetCalculations\n Get the ingredient bases and calculated properties on the sheet (Manage Worksheet).\nadd_calculation(attribute_id, display_name) -> SheetCalculations\n Add an ingredient basis or calculated property to the sheet.\nremove_calculation(attribute_id, display_name) -> SheetCalculations\n Remove an ingredient basis or calculated property from the sheet.\nadd_parameter_group_row(parameter_group_id, ...) -> Row\n Add a parameter group (PRG) row to Process Design.\nadd_task_row(task_id, ...) -> Row\n Link a task into the Results section as a task (TAS) row.\nadd_blank_column(name, ...) -> Column\n Add a blank column.\nadd_columns(names, ...) -> list[Column]\n Add multiple columns of one type in one call.\nadd_lookup_column(name, ...) -> Column\n Add a lookup column.\nadd_function_column(name, ...) -> Column\n Add a function column.\nadd_property_column(name, attribute_id, ...) -> Column\n Add a property/result column.\nget_column(...) -> Column\n Retrieve a column by column ID, inventory ID, or name.\nupdate_cells(cells) -> tuple[list[Cell], list[Cell]]\n Write changed cells back to the sheet.\npin_columns(col_ids, side) -> None\n Pin columns to the left or right edge.\nunpin_columns(col_ids) -> None\n Unpin columns.\nlock_column(...) -> Column\n Lock or unlock a column.\nlock_columns(column_ids, locked=True) -> None\n Lock or unlock multiple columns in one call.\nrename_columns(columns) -> None\n Rename multiple columns in one call.\nhide_column(col_id) -> None\n Hide a column.\nhide_columns(column_ids) -> None\n Hide multiple columns in one call.\nshow_column(col_id) -> None\n Show a hidden column.\nshow_columns(column_ids) -> None\n Show multiple hidden columns in one call.\nset_columns_width(col_ids, width) -> None\n Set the display width of columns.\nreorder_columns(column_ids) -> None\n Reorder all columns left to right by column ID.\ndelete_column(column_id) -> None\n Delete a column.\ndelete_columns(column_ids) -> None\n Delete multiple columns in one call.\ndelete_row(row_id, design_id) -> None\n Delete a row.\ndelete_rows(row_ids, design_id) -> None\n Delete multiple rows from a Design section in one call.\nmove_rows(row_ids, reference_id, design_id, ...) -> None\n Move (reorder) rows within a Design section, above or below a reference row.",
"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": {
"description": "The Albert ID of the sheet.",
"title": "Albertid",
"type": "string"
},
"name": {
"description": "The name of the sheet.",
"title": "Name",
"type": "string"
},
"Formulas": {
"description": "References to the formulations present on the sheet.",
"items": {
"$ref": "#/$defs/SheetFormulationRef"
},
"title": "Formulas",
"type": "array"
},
"hidden": {
"description": "Whether the sheet is hidden.",
"title": "Hidden",
"type": "boolean"
},
"isColumnRight": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "When True, copied columns are placed to the right of the source column; when False, to the left.",
"title": "Iscolumnright"
},
"colSizeMode": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Column width sizing mode. Allowed values are ``\"minimum\"`` and ``\"fitToColumn\"``. ``None`` resets to the default grid width.",
"title": "Colsizemode"
},
"Designs": {
"description": "The Designs (sections) of the sheet.",
"items": {
"$ref": "#/$defs/Design"
},
"title": "Designs",
"type": "array"
},
"projectId": {
"description": "The ID of the Project the sheet belongs to (format ``PRO...``).",
"title": "Projectid",
"type": "string"
}
},
"required": [
"albertId",
"name",
"hidden",
"Designs",
"projectId"
],
"title": "Sheet",
"type": "object"
},
"SheetFormulationRef": {
"description": "A reference to a formulation in a sheet",
"properties": {
"id": {
"description": "The Albert ID of the inventory item that is the formulation",
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The name of the formulation",
"title": "Name"
},
"hidden": {
"description": "Whether the formulation is hidden",
"title": "Hidden",
"type": "boolean"
}
},
"required": [
"id",
"hidden"
],
"title": "SheetFormulationRef",
"type": "object"
},
"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"
}
},
"description": "A row in a Sheet.\n\nA Row is a live grid element that carries the session. Rows typically\nrepresent ingredients (inventory items) and their amounts, but a row can also\nbe a total, lookup, app, or blank row per its [`type`][albert.resources.sheets.Row.type]. Each row belongs\nto a specific [`Design`][albert.resources.sheets.Design] section of the [`sheet`][albert.resources.sheets.Row.sheet]. Its cells are read\nthrough [`cells`][albert.resources.sheets.Row.cells] and written back with [`update_cells`][albert.resources.sheets.Sheet.update_cells].\nMethods\n-------\nrecolor_cells(color) -> tuple[list[Cell], list[Cell]]\n Apply a background color to every cell in the row.\nrename(new_name) -> Row\n Rename the row.\nreplace_inventory(inventory) -> Row\n Replace (swap) the inventory item on the row.",
"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."
},
"rowId": {
"description": "The ID of the row.",
"title": "Rowid",
"type": "string"
},
"type": {
"anyOf": [
{
"$ref": "#/$defs/CellType"
},
{
"type": "string"
}
],
"description": "The type of the row. Allowed values are the same as for [`CellType`][albert.resources.sheets.CellType].",
"title": "Type"
},
"design": {
"$ref": "#/$defs/Design",
"description": "The Design (section) the row belongs to."
},
"sheet": {
"$ref": "#/$defs/Sheet",
"description": "The sheet the row belongs to."
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display name of the row. Optional. Default is None.",
"title": "Name"
},
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "For an ingredient row, the inventory ID of the item (format ``INV...``). Optional. Default is None.",
"title": "Id"
},
"manufacturer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The manufacturer of the row's inventory item. Optional. Default is None.",
"title": "Manufacturer"
},
"config": {
"anyOf": [
{
"$ref": "#/$defs/RowConfig"
},
{
"type": "null"
}
],
"default": null,
"description": "Configuration for APP or location-scoped rows. Optional. Default is None."
},
"parent_row_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The row ID of the group header this row belongs to. None if not grouped.",
"title": "Parent Row Id"
},
"child_row_ids": {
"description": "Row IDs of rows grouped under this row. Non-empty only on group header rows.",
"items": {
"type": "string"
},
"title": "Child Row Ids",
"type": "array"
}
},
"required": [
"rowId",
"type",
"design",
"sheet"
],
"title": "Row",
"type": "object"
}
Fields:
-
status(Status | None) -
created(AuditFields | None) -
updated(AuditFields | None) -
row_id(str) -
type(CellType | str) -
design(Design) -
sheet(Sheet) -
name(str | None) -
inventory_id(str | None) -
manufacturer(str | None) -
config(RowConfig | None) -
parent_row_id(str | None) -
child_row_ids(list[str])
Validators:
-
_bind_session -
_coerce_config→config
inventory_id
inventory_id: str | None = None
For an ingredient row, the inventory ID of the item (format INV...). Optional. Default is None.
manufacturer
manufacturer: str | None = None
The manufacturer of the row's inventory item. Optional. Default is None.
config
config: RowConfig | None = None
Configuration for APP or location-scoped rows. Optional. Default is None.
parent_row_id
parent_row_id: str | None = None
The row ID of the group header this row belongs to. None if not grouped.
child_row_ids
Row IDs of rows grouped under this row. Non-empty only on group header rows.
cells
This row's cells as a pandas Series keyed by column df-name.
Empty cells may appear as NaN floats (pandas padding); check
isinstance(value, Cell) before using a value.
recolor_cells
recolor_cells(color: CellColor)
Apply a background color to every cell in this row.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
color
|
CellColor
|
The background color to apply. |
required |
Returns:
| Type | Description |
|---|---|
tuple[list[Cell], list[Cell]]
|
A |
Source code in src/albert/resources/sheets.py
rename
Rename this row.
Only blank rows, including row group headers, and task rows can be renamed.
To rename a row group, rename its header row (the Row
whose row_id matches the group's row_id).
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
new_name
|
str
|
The new name for the row. Must be a non-empty string of at most 255 characters. |
required |
Returns:
| Type | Description |
|---|---|
Row
|
This row, with its name updated. |
Raises:
| Type | Description |
|---|---|
AlbertException
|
If the row is not a blank or task row, or if |
Source code in src/albert/resources/sheets.py
replace_inventory
replace_inventory(
*, inventory: InventoryItem | InventoryId
) -> Row
Replace (swap) the inventory item on this ingredient row.
The row keeps its place on the sheet and stays linked to its cells; only the inventory item it represents changes. The item's display name becomes the row name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inventory
|
InventoryItem or str
|
The inventory item to place on the row, or its ID (format |
required |
Returns:
| Type | Description |
|---|---|
Row
|
This row, with its new inventory item. |
Raises:
| Type | Description |
|---|---|
AlbertException
|
If this row is not an ingredient ( |
Source code in src/albert/resources/sheets.py
5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 | |