Product Design
albert.collections.product_design
AlbertSession
AlbertSession(
*,
base_url: str,
token: str | None = None,
auth_manager: AlbertClientCredentials
| AlbertSSOClient
| None = None,
retries: int | None = None,
)
Bases: Session
A session that has a base URL, which is prefixed to all request URLs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_url
|
str
|
The base URL to prefix to all relative request paths (e.g., "https://app.albertinvent.com"). |
required |
token
|
str | None
|
A static JWT token for authentication. Ignored if |
None
|
auth_manager
|
AlbertClientCredentials | AlbertSSOClient
|
An authentication manager used to dynamically fetch and refresh tokens.
If provided, it overrides |
None
|
retries
|
int
|
The number of automatic retries on failed requests (default is 3). |
None
|
Methods:
| Name | Description |
|---|---|
request |
|
Source code in src/albert/core/session.py
request
Source code in src/albert/core/session.py
BaseCollection
BaseCollection(*, session: AlbertSession)
BaseCollection is the base class for all collection classes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
AlbertSession
|
The Albert API Session instance. |
required |
Source code in src/albert/collections/base.py
ProductDesignCollection
ProductDesignCollection(*, session: AlbertSession)
Bases: BaseCollection
ProductDesignCollection is a collection class for managing Product Design entities in the Albert platform.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
AlbertSession
|
The Albert session instance. |
required |
Methods:
| Name | Description |
|---|---|
get_unpacked_products |
Get unpacked products by inventory IDs. |
Source code in src/albert/collections/product_design.py
get_unpacked_products
get_unpacked_products(
*,
inventory_ids: list[InventoryId],
unpack_id: Literal[
"DESIGN", "PREDICTION"
] = "PREDICTION",
) -> list[UnpackedProductDesign]
Get unpacked products by inventory IDs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inventory_ids
|
list[InventoryId]
|
The inventory ids to get unpacked formulas for. |
required |
unpack_id
|
Literal['DESIGN', 'PREDICTION']
|
The ID for the unpack operation. |
'PREDICTION'
|
Returns:
| Type | Description |
|---|---|
list[UnpackedProductDesign]
|
The unpacked products/formulas. |
Source code in src/albert/collections/product_design.py
UnpackedProductDesign
pydantic-model
Bases: BaseAlbertModel
Show JSON schema:
{
"$defs": {
"CasLevelSubstance": {
"properties": {
"casPrimaryKeyId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Casprimarykeyid"
},
"casID": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Casid"
},
"amount": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"title": "Amount"
}
},
"title": "CasLevelSubstance",
"type": "object"
},
"NormalizedCAS": {
"properties": {
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"value": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"title": "Value"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Albertid"
},
"smiles": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Smiles"
}
},
"title": "NormalizedCAS",
"type": "object"
},
"UnpackedCasInfo": {
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Id"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"min": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"title": "Min"
},
"max": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"title": "Max"
},
"number": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Number"
},
"casAvg": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"title": "Casavg"
},
"casSum": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"title": "Cassum"
}
},
"title": "UnpackedCasInfo",
"type": "object"
},
"UnpackedInventory": {
"properties": {
"rowInventoryId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Rowinventoryid"
},
"value": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"title": "Value"
},
"colId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Colid"
},
"colInventoryId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Colinventoryid"
},
"parentId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Parentid"
},
"rowId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Rowid"
},
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Id"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"rsnNumber": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Rsnnumber"
},
"totalCasSum": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"title": "Totalcassum"
},
"sdsInfo": {
"anyOf": [
{
"$ref": "#/$defs/UnpackedInventorySDS"
},
{
"type": "null"
}
],
"default": null
},
"casInfo": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/UnpackedCasInfo"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Casinfo"
}
},
"title": "UnpackedInventory",
"type": "object"
},
"UnpackedInventoryListItem": {
"properties": {
"rowInventoryId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Rowinventoryid"
},
"value": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"title": "Value"
},
"colId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Colid"
},
"colInventoryId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Colinventoryid"
},
"parentId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Parentid"
},
"rowId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Rowid"
}
},
"title": "UnpackedInventoryListItem",
"type": "object"
},
"UnpackedInventorySDS": {
"properties": {
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Albertid"
},
"value": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"title": "Value"
},
"class": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Class"
},
"unNumber": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Unnumber"
}
},
"title": "UnpackedInventorySDS",
"type": "object"
}
},
"properties": {
"Inventories": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/UnpackedInventory"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Inventories"
},
"inventoryList": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/UnpackedInventoryListItem"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Inventorylist"
},
"inventorySDSList": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/UnpackedInventorySDS"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Inventorysdslist"
},
"casLevelSubstances": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/CasLevelSubstance"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Caslevelsubstances"
},
"normalizedCasList": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/NormalizedCAS"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Normalizedcaslist"
}
},
"title": "UnpackedProductDesign",
"type": "object"
}
Fields:
-
inventories(list[UnpackedInventory] | None) -
inventory_list(list[UnpackedInventoryListItem] | None) -
inventory_sds_list(list[UnpackedInventorySDS] | None) -
cas_level_substances(list[CasLevelSubstance] | None) -
normalized_cas_list(list[NormalizedCAS] | None)