Product Design
albert.collections.product_design.ProductDesignCollection
Bases: BaseCollection
Search the product design grid and unpack formulated products.
Two separate capabilities live here:
searchdiscovers formulations on the product design grid by free text, facets, and project / inventory filters, returning lightweight formula hits.get_unpacked_productsflattens a formulation inventory item into its full substance-level composition, described below.
An unpacked product resolves a formulation's complete substance composition by recursively traversing its ingredient tree: each sub-formulation is expanded into its own ingredients, with fractional contributions multiplied down through each level and summed at the CAS-number level. It produces two outputs: a row-level inventory list (the direct worksheet ingredients, some of which may themselves be sub-formulations) and a flat CAS-level substance list (fully resolved raw materials with combined weight fractions).
The calculation assumes a non-reactive, homogeneous mixture: no chemical transformations occur and concentrations are additive. When a formulation has overrides, the recursive traversal short-circuits; Albert accepts the declared composition at face value rather than deriving it, and CAS amounts are expressed as ranges to signal supplied (not bottom-up calculated) values.
Use this when you need the resolved composition of a formula rather than just
its immediate ingredient list, for example to compute regulatory or safety
rollups. The formulas being unpacked are Inventory Items in the Formulas
category (see InventoryCollection), and
the substances resolve to CAS entries (see
CasCollection).
This collection is accessed as client.product_design.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
AlbertSession
|
The authenticated Albert session used for API calls. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
base_path |
str
|
The base API route for product design requests. |
Methods:
| Name | Description |
|---|---|
search |
Search for formulations on the product design grid matching the given filters. |
get_unpacked_products |
Unpack one or more formulas into their full CAS-level substance composition. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
AlbertSession
|
The authenticated Albert session used for API calls. |
required |
Source code in src/albert/collections/product_design.py
search
search(
*,
text: str | None = None,
project_id: SearchProjectId | None = None,
tags: str | list[str] | None = None,
albert_id: str | list[str] | None = None,
state: str | list[str] | None = None,
data_template: str | list[str] | None = None,
inventory_name: str | list[str] | None = None,
inventory_id: str | list[str] | None = None,
formula_created_by: str | list[str] | None = None,
facet_text: str | None = None,
facet_field: str | None = None,
contains_field: str | list[str] | None = None,
contains_text: str | list[str] | None = None,
source_field: str | list[str] | None = None,
product_grid: bool | None = None,
sort_by: str | None = None,
order: OrderBy | None = None,
max_items: int | None = None,
) -> Iterator[ProductDesignSearchItem]
Search for formulations on the product design grid matching the given filters.
Returns lightweight, partially populated
ProductDesignSearchItem
hits, best for free-text lookups, counts, and pulling formula IDs. When you
need the complete formula, pass the hit's id to
get_by_id.
Results are returned as a lazily paginated iterator.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Free-text query matched against formula fields. |
None
|
project_id
|
SearchProjectId
|
Scope the search to a project (format |
None
|
tags
|
str or list[str]
|
Filter by tag name(s). |
None
|
albert_id
|
str or list[str]
|
Filter by formula Inventory ID(s) (format |
None
|
state
|
str or list[str]
|
Filter by formula lock/unlock state(s). |
None
|
data_template
|
str or list[str]
|
Filter by data template name(s). |
None
|
inventory_name
|
str or list[str]
|
Filter by ingredient name(s). |
None
|
inventory_id
|
str or list[str]
|
Filter by ingredient Inventory ID(s). |
None
|
formula_created_by
|
str or list[str]
|
Filter by formula creator(s). |
None
|
facet_text
|
str
|
Text to match within a facet search. |
None
|
facet_field
|
str
|
Field to search within for facet filtering. |
None
|
contains_field
|
str or list[str]
|
Field(s) to apply a "contains" search to. |
None
|
contains_text
|
str or list[str]
|
Text value(s) for the "contains" search. |
None
|
source_field
|
str or list[str]
|
Restrict which fields are returned on each search hit. |
None
|
product_grid
|
bool
|
Search the product grid shown on the project homepage. |
None
|
sort_by
|
str
|
Attribute to sort results by. |
None
|
order
|
OrderBy
|
The order in which to sort results ( |
None
|
max_items
|
int
|
Maximum number of items to return in total. If None, iterates over all matching items. |
None
|
Returns:
| Type | Description |
|---|---|
Iterator[ProductDesignSearchItem]
|
A lazy iterator of matching formula hits. |
Source code in src/albert/collections/product_design.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | |
get_unpacked_products
get_unpacked_products(
*,
inventory_ids: list[InventoryId],
unpack_id: Literal[
"DESIGN", "PREDICTION"
] = "PREDICTION",
) -> list[UnpackedProductDesign]
Unpack formulas into their full CAS-level substance composition.
Each supplied formula is flattened into its constituent substances, with
their amounts, CAS information, and SDS / regulatory details. One
UnpackedProductDesign is returned
per input formula. Requests are automatically split into batches of 50
inventory IDs, so large lists can be passed in a single call. To discover
formula IDs by text or filters, use
search.
For an ingredient's total amount in a product, including amounts that come
from nested sub-formulations, read inventories[].value. inventory_list
holds only the formula's direct entries, and normalized_cas_list is
purity-adjusted at the CAS level.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inventory_ids
|
list[InventoryId]
|
The formula Inventory IDs to unpack (format |
required |
unpack_id
|
(DESIGN, PREDICTION)
|
Which unpacking mode the server should use. Defaults to |
"DESIGN"
|
Returns:
| Type | Description |
|---|---|
list[UnpackedProductDesign]
|
The unpacked composition, one entry per input formula. |