Inventory
albert.resources.inventory
Attributes:
Name | Type | Description |
---|---|---|
ALL_MERGE_MODULES |
All modules selectable for inventory merge. |
ALL_MERGE_MODULES
ALL_MERGE_MODULES = [
"PRICING",
"NOTES",
"SDS",
"PD",
"BD",
"LOT",
"CAS",
"TAS",
"WFL",
"PRG",
"PTD",
]
All modules selectable for inventory merge.
InventoryCategory
Attributes:
Name | Type | Description |
---|---|---|
RAW_MATERIALS |
|
|
CONSUMABLES |
|
|
EQUIPMENT |
|
|
FORMULAS |
|
InventoryUnitCategory
CasAmount
Bases: BaseAlbertModel
CasAmount is a Pydantic model representing an amount of a given CAS.
Attributes:
Name | Type | Description |
---|---|---|
min |
float
|
The minimum amount of the CAS in the formulation. |
max |
float
|
The maximum amount of the CAS in the formulation. |
id |
str | None
|
The Albert ID of the CAS Number Resource this amount represents. Provide either a Cas or an ID. |
cas |
Cas | None
|
The CAS object associated with this amount. Provide either a Cas or an id. |
cas_smiles |
str | None
|
The SMILES string of the CAS Number resource. Obtained from the Cas object when provided. |
number |
str | None
|
The CAS number. Obtained from the Cas object when provided. |
Show JSON schema:
{
"$defs": {
"Cas": {
"description": "Represents a CAS entity.",
"properties": {
"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"
},
"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": "Type of the CAS.",
"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"
}
},
"required": [
"number"
],
"title": "Cas",
"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"
},
"Hazard": {
"description": "Represents a chemical hazard.",
"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"
}
},
"description": "CasAmount is a Pydantic model representing an amount of a given CAS.\n\nAttributes\n----------\nmin : float\n The minimum amount of the CAS in the formulation.\nmax : float\n The maximum amount of the CAS in the formulation.\nid : str | None\n The Albert ID of the CAS Number Resource this amount represents. Provide either a Cas or an ID.\ncas : Cas | None\n The CAS object associated with this amount. Provide either a Cas or an id.\ncas_smiles: str | None\n The SMILES string of the CAS Number resource. Obtained from the Cas object when provided.\nnumber: str | None\n The CAS number. Obtained from the Cas object when provided.",
"properties": {
"min": {
"title": "Min",
"type": "number"
},
"max": {
"title": "Max",
"type": "number"
},
"inventoryValue": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"title": "Inventoryvalue"
},
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Id"
},
"casCategory": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Cascategory"
},
"cas": {
"anyOf": [
{
"$ref": "#/$defs/Cas"
},
{
"type": "null"
}
],
"default": null
},
"casSmiles": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Cassmiles"
},
"number": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Number"
}
},
"required": [
"min",
"max"
],
"title": "CasAmount",
"type": "object"
}
Fields:
-
min
(float
) -
max
(float
) -
target
(float | None
) -
id
(str | None
) -
cas_category
(str | None
) -
cas
(Cas | None
) -
cas_smiles
(str | None
) -
number
(str | None
)
Validators:
set_cas_attributes
set_cas_attributes() -> CasAmount
Set attributes after model initialization from the Cas object, if provided.
Source code in src/albert/resources/inventory.py
InventoryMinimum
Bases: BaseAlbertModel
Defined the minimum amount of an InventoryItem that must be kept in stock at a given Location.
Attributes:
Name | Type | Description |
---|---|---|
id |
str
|
The unique identifier of the Location object associated with this InventoryMinimum. Provide either a Location or a location id. |
location |
Location
|
The Location object associated with this InventoryMinimum. Provide either a Location or a location id. |
minimum |
float
|
The minimum amount of the InventoryItem that must be kept in stock at the given Location. |
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"
},
"Location": {
"description": "A location in Albert.\n\nAttributes\n----------\nname : str\n The name of the location.\nid : str | None\n The Albert ID of the location. Set when the location is retrieved from Albert.\nlatitude : float\n The latitude of the location.\nlongitude : float\n The longitude of the location.\naddress : str\n The address of the location.\ncountry : str | None\n The country code of the location. Must be two characters long.",
"properties": {
"status": {
"anyOf": [
{
"$ref": "#/$defs/Status"
},
{
"type": "null"
}
],
"default": null
},
"Created": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null
},
"Updated": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null
},
"name": {
"title": "Name",
"type": "string"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Albertid"
},
"latitude": {
"title": "Latitude",
"type": "number"
},
"longitude": {
"title": "Longitude",
"type": "number"
},
"address": {
"title": "Address",
"type": "string"
},
"country": {
"anyOf": [
{
"maxLength": 2,
"minLength": 2,
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Country"
}
},
"required": [
"name",
"latitude",
"longitude",
"address"
],
"title": "Location",
"type": "object"
},
"Status": {
"description": "The status of a resource",
"enum": [
"active",
"inactive"
],
"title": "Status",
"type": "string"
}
},
"description": "Defined the minimum amount of an InventoryItem that must be kept in stock at a given Location.\n\nAttributes\n----------\nid : str\n The unique identifier of the Location object associated with this InventoryMinimum.\n Provide either a Location or a location id.\nlocation : Location\n The Location object associated with this InventoryMinimum. Provide either a Location or a location id.\nminimum : float\n The minimum amount of the InventoryItem that must be kept in stock at the given Location.",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Id"
},
"location": {
"anyOf": [
{
"$ref": "#/$defs/Location"
},
{
"type": "null"
}
],
"default": null
},
"minimum": {
"maximum": 1000000000000000,
"minimum": 0,
"title": "Minimum",
"type": "number"
}
},
"required": [
"minimum"
],
"title": "InventoryMinimum",
"type": "object"
}
Fields:
Validators:
check_id_or_location
check_id_or_location() -> InventoryMinimum
Ensure that either an id or a location is provided.
Source code in src/albert/resources/inventory.py
InventoryItem
Bases: BaseTaggedResource
An InventoryItem is a Pydantic model representing an item in the inventory. Can be a raw material, consumable, equipment, or formula. Note: Formulas should be registered via the Worksheet collection / Sheet resource.
Returns:
Type | Description |
---|---|
InventoryItem
|
An InventoryItem that can be used to represent an item in the inventory. Can be a raw material, consumable, equipment, or formula. |
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
The name of the InventoryItem. |
id |
str | None
|
The Albert ID of the InventoryItem. Set when the InventoryItem is retrieved from Albert. |
description |
str | None
|
The description of the InventoryItem. |
category |
InventoryCategory
|
The category of the InventoryItem. Allowed values are |
unit_category |
InventoryUnitCategory
|
The unit category of the InventoryItem. Can be mass, volume, length, pressure, or units. By default, mass is used for RawMaterials and Formulas, and units is used for Equipment and Consumables. |
security_class |
SecurityClass | None
|
The security class of the InventoryItem. Optional. Can be confidential, shared, or restricted. |
company |
Company | str | None
|
The company associated with the InventoryItem. Can be a Company object or a string. If a String is provided, a Company object with the name of the provided string will be first-or-created. |
minimum |
list[InventoryMinimum] | None
|
The minimum amount of the InventoryItem that must be kept in stock at a given Location. Optional. |
alias |
str | None
|
An alias for the InventoryItem. Optional. |
cas |
list[CasAmount] | None
|
The CAS numbers associated with the InventoryItem. This is how a compositional breakdown can be provided. Optional. |
metadata |
dict[str, str | list[EntityLink] | EntityLink] | None
|
Metadata associated with the InventoryItem. Optional. Allowed metadata fields can be found in the CustomFields documentation. |
project_id |
str | None
|
The project ID associated with the InventoryItem. Read Only. Required for Formulas. |
formula_id |
str | None
|
The formula ID associated with the InventoryItem. Read Only. |
tags |
list[str | Tag] | None
|
The tags associated with the InventoryItem. Optional. If a string is provided, a Tag object with the name of the provided string will be first-or-created. |
Show JSON schema:
{
"$defs": {
"ACL": {
"description": "The Access Control List (ACL) 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": "The fine grain control",
"enum": [
"ProjectOwner",
"ProjectEditor",
"ProjectViewer",
"ProjectAllTask",
"ProjectPropertyTask",
"InventoryOwner",
"InventoryViewer",
"CustomTemplateOwner"
],
"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"
},
"Cas": {
"description": "Represents a CAS entity.",
"properties": {
"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"
},
"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": "Type of the CAS.",
"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"
}
},
"required": [
"number"
],
"title": "Cas",
"type": "object"
},
"CasAmount": {
"description": "CasAmount is a Pydantic model representing an amount of a given CAS.\n\nAttributes\n----------\nmin : float\n The minimum amount of the CAS in the formulation.\nmax : float\n The maximum amount of the CAS in the formulation.\nid : str | None\n The Albert ID of the CAS Number Resource this amount represents. Provide either a Cas or an ID.\ncas : Cas | None\n The CAS object associated with this amount. Provide either a Cas or an id.\ncas_smiles: str | None\n The SMILES string of the CAS Number resource. Obtained from the Cas object when provided.\nnumber: str | None\n The CAS number. Obtained from the Cas object when provided.",
"properties": {
"min": {
"title": "Min",
"type": "number"
},
"max": {
"title": "Max",
"type": "number"
},
"inventoryValue": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"title": "Inventoryvalue"
},
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Id"
},
"casCategory": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Cascategory"
},
"cas": {
"anyOf": [
{
"$ref": "#/$defs/Cas"
},
{
"type": "null"
}
],
"default": null
},
"casSmiles": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Cassmiles"
},
"number": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Number"
}
},
"required": [
"min",
"max"
],
"title": "CasAmount",
"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": "Company is a Pydantic model representing a company entity.\n\nAttributes\n----------\nname : str\n The name of the company.\nid : str | None\n The Albert ID of the company. Set when the company is retrieved from Albert.\ndistance : float | None\n The scores of a company in a search result, optional. Read-only.",
"properties": {
"status": {
"anyOf": [
{
"$ref": "#/$defs/Status"
},
{
"type": "null"
}
],
"default": null
},
"Created": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null
},
"Updated": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null
},
"name": {
"title": "Name",
"type": "string"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Albertid"
},
"distance": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"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"
}
},
"required": [
"id"
],
"title": "EntityLink",
"type": "object"
},
"Hazard": {
"description": "Represents a chemical hazard.",
"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": {
"enum": [
"RawMaterials",
"Consumables",
"Equipment",
"Formulas"
],
"title": "InventoryCategory",
"type": "string"
},
"InventoryMinimum": {
"description": "Defined the minimum amount of an InventoryItem that must be kept in stock at a given Location.\n\nAttributes\n----------\nid : str\n The unique identifier of the Location object associated with this InventoryMinimum.\n Provide either a Location or a location id.\nlocation : Location\n The Location object associated with this InventoryMinimum. Provide either a Location or a location id.\nminimum : float\n The minimum amount of the InventoryItem that must be kept in stock at the given Location.",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Id"
},
"location": {
"anyOf": [
{
"$ref": "#/$defs/Location"
},
{
"type": "null"
}
],
"default": null
},
"minimum": {
"maximum": 1000000000000000,
"minimum": 0,
"title": "Minimum",
"type": "number"
}
},
"required": [
"minimum"
],
"title": "InventoryMinimum",
"type": "object"
},
"InventoryUnitCategory": {
"enum": [
"mass",
"volume",
"length",
"pressure",
"units"
],
"title": "InventoryUnitCategory",
"type": "string"
},
"Location": {
"description": "A location in Albert.\n\nAttributes\n----------\nname : str\n The name of the location.\nid : str | None\n The Albert ID of the location. Set when the location is retrieved from Albert.\nlatitude : float\n The latitude of the location.\nlongitude : float\n The longitude of the location.\naddress : str\n The address of the location.\ncountry : str | None\n The country code of the location. Must be two characters long.",
"properties": {
"status": {
"anyOf": [
{
"$ref": "#/$defs/Status"
},
{
"type": "null"
}
],
"default": null
},
"Created": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null
},
"Updated": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null
},
"name": {
"title": "Name",
"type": "string"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Albertid"
},
"latitude": {
"title": "Latitude",
"type": "number"
},
"longitude": {
"title": "Longitude",
"type": "number"
},
"address": {
"title": "Address",
"type": "string"
},
"country": {
"anyOf": [
{
"maxLength": 2,
"minLength": 2,
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Country"
}
},
"required": [
"name",
"latitude",
"longitude",
"address"
],
"title": "Location",
"type": "object"
},
"SecurityClass": {
"description": "The security class of a resource",
"enum": [
"shared",
"restricted",
"confidential",
"private",
"public"
],
"title": "SecurityClass",
"type": "string"
},
"Status": {
"description": "The status of a resource",
"enum": [
"active",
"inactive"
],
"title": "Status",
"type": "string"
},
"Tag": {
"description": "Tag is a Pydantic model representing a tag entity.\n\nAttributes\n----------\ntag : str\n The name of the tag.\nid : str | None\n The Albert ID of the tag. Set when the tag is retrieved from Albert.\n\nMethods\n-------\nfrom_string(tag: str) -> \"Tag\"\n Creates a Tag object from a string.",
"properties": {
"status": {
"anyOf": [
{
"$ref": "#/$defs/Status"
},
{
"type": "null"
}
],
"default": null
},
"Created": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null
},
"Updated": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null
},
"name": {
"title": "Name",
"type": "string"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Albertid"
}
},
"required": [
"name"
],
"title": "Tag",
"type": "object"
}
},
"description": "An InventoryItem is a Pydantic model representing an item in the inventory. Can be a raw material, consumable, equipment, or formula.\nNote: Formulas should be registered via the Worksheet collection / Sheet resource.\n\nReturns\n-------\nInventoryItem\n An InventoryItem that can be used to represent an item in the inventory. Can be a raw material, consumable, equipment, or formula.\n\nAttributes\n------\n\nname : str\n The name of the InventoryItem.\nid : str | None\n The Albert ID of the InventoryItem. Set when the InventoryItem is retrieved from Albert.\ndescription : str | None\n The description of the InventoryItem.\ncategory : InventoryCategory\n The category of the InventoryItem. Allowed values are `RawMaterials`, `Consumables`, `Equipment`, and `Formulas`.\nunit_category : InventoryUnitCategory\n The unit category of the InventoryItem. Can be mass, volume, length, pressure, or units. By default, mass is used for RawMaterials and Formulas, and units is used for Equipment and Consumables.\nsecurity_class : SecurityClass | None\n The security class of the InventoryItem. Optional. Can be confidential, shared, or restricted.\ncompany : Company | str | None\n The company associated with the InventoryItem. Can be a Company object or a string. If a String is provided, a Company object with the name of the provided string will be first-or-created.\nminimum : list[InventoryMinimum] | None\n The minimum amount of the InventoryItem that must be kept in stock at a given Location. Optional.\nalias : str | None\n An alias for the InventoryItem. Optional.\ncas : list[CasAmount] | None\n The CAS numbers associated with the InventoryItem. This is how a compositional breakdown can be provided. Optional.\nmetadata : dict[str, str | list[EntityLink] | EntityLink] | None\n Metadata associated with the InventoryItem. Optional. Allowed metadata fields can be found in the CustomFields documentation.\nproject_id : str | None\n The project ID associated with the InventoryItem. Read Only. Required for Formulas.\nformula_id : str | None\n The formula ID associated with the InventoryItem. Read Only.\ntags : list[str|Tag] | None\n The tags associated with the InventoryItem. Optional. If a string is provided, a Tag object with the name of the provided string will be first-or-created.",
"properties": {
"status": {
"anyOf": [
{
"$ref": "#/$defs/Status"
},
{
"type": "null"
}
],
"default": null
},
"Created": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null
},
"Updated": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null
},
"Tags": {
"anyOf": [
{
"items": {
"anyOf": [
{
"$ref": "#/$defs/Tag"
},
{
"$ref": "#/$defs/EntityLink"
}
]
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Tags"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Albertid"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Description"
},
"category": {
"$ref": "#/$defs/InventoryCategory"
},
"unitCategory": {
"anyOf": [
{
"$ref": "#/$defs/InventoryUnitCategory"
},
{
"type": "null"
}
],
"default": null
},
"class": {
"anyOf": [
{
"$ref": "#/$defs/SecurityClass"
},
{
"type": "null"
}
],
"default": null
},
"Company": {
"anyOf": [
{
"$ref": "#/$defs/Company"
},
{
"$ref": "#/$defs/EntityLink"
},
{
"type": "null"
}
],
"default": null,
"title": "Company"
},
"minimum": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/InventoryMinimum"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Minimum"
},
"alias": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Alias"
},
"Cas": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/CasAmount"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Cas"
},
"Metadata": {
"anyOf": [
{
"additionalProperties": {
"anyOf": [
{
"type": "number"
},
{
"type": "integer"
},
{
"type": "string"
},
{
"$ref": "#/$defs/EntityLink"
},
{
"items": {
"$ref": "#/$defs/EntityLink"
},
"type": "array"
},
{
"type": "null"
}
]
},
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"title": "Metadata"
},
"parentId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Parentid"
},
"ACL": {
"items": {
"$ref": "#/$defs/ACL"
},
"title": "Acl",
"type": "array"
},
"TaskConfig": {
"anyOf": [
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Taskconfig"
},
"formulaId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Formulaid"
},
"Symbols": {
"anyOf": [
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Symbols"
},
"unNumber": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Unnumber"
},
"recentAttachmentId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Recentattachmentid"
}
},
"required": [
"category"
],
"title": "InventoryItem",
"type": "object"
}
Fields:
-
status
(Status | None
) -
created
(AuditFields | None
) -
updated
(AuditFields | None
) -
tags
(list[SerializeAsEntityLink[Tag]] | None
) -
name
(str | None
) -
id
(str | None
) -
description
(str | None
) -
category
(InventoryCategory
) -
unit_category
(InventoryUnitCategory | None
) -
security_class
(SecurityClass | None
) -
company
(SerializeAsEntityLink[Company] | None
) -
minimum
(list[InventoryMinimum] | None
) -
alias
(str | None
) -
cas
(list[CasAmount] | None
) -
metadata
(dict[str, MetadataItem] | None
) -
project_id
(str | None
) -
acls
(list[ACL]
) -
task_config
(list[dict] | None
) -
formula_id
(str | None
) -
symbols
(list[dict] | None
) -
un_number
(str | None
) -
recent_atachment_id
(str | None
)
Validators:
-
validate_company_string
→company
-
validate_un_number
→un_number
-
set_unit_category
-
validate_formula_fields
validate_company_string
validate_un_number
set_unit_category
set_unit_category() -> InventoryItem
Set unit category from category if not defined.
Source code in src/albert/resources/inventory.py
validate_formula_fields
validate_formula_fields() -> InventoryItem
Ensure required fields are present for formulas.
Source code in src/albert/resources/inventory.py
InventorySpecValue
Bases: BaseAlbertModel
Show JSON schema:
{
"properties": {
"min": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Min"
},
"max": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Max"
},
"reference": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Reference"
},
"comparisonOperator": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Comparisonoperator"
}
},
"title": "InventorySpecValue",
"type": "object"
}
Fields:
InventorySpec
Bases: BaseAlbertModel
Show JSON schema:
{
"$defs": {
"InventorySpecValue": {
"properties": {
"min": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Min"
},
"max": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Max"
},
"reference": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Reference"
},
"comparisonOperator": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Comparisonoperator"
}
},
"title": "InventorySpecValue",
"type": "object"
}
},
"properties": {
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Albertid"
},
"name": {
"title": "Name",
"type": "string"
},
"datacolumnId": {
"title": "Datacolumnid",
"type": "string"
},
"datacolumnName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Datacolumnname"
},
"datatemplateId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Datatemplateid"
},
"datatemplateName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Datatemplatename"
},
"unitId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Unitid"
},
"unitName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Unitname"
},
"workflowId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Workflowid"
},
"workflowName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Workflowname"
},
"specConfig": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Specconfig"
},
"Value": {
"anyOf": [
{
"$ref": "#/$defs/InventorySpecValue"
},
{
"type": "null"
}
],
"default": null
}
},
"required": [
"name",
"datacolumnId"
],
"title": "InventorySpec",
"type": "object"
}
Fields:
-
id
(str | None
) -
name
(str
) -
data_column_id
(str
) -
data_column_name
(str | None
) -
data_template_id
(str | None
) -
data_template_name
(str | None
) -
unit_id
(str | None
) -
unit_name
(str | None
) -
workflow_id
(str | None
) -
workflow_name
(str | None
) -
spec_config
(str | None
) -
value
(InventorySpecValue | None
)
InventorySpecList
Bases: BaseAlbertModel
Show JSON schema:
{
"$defs": {
"InventorySpec": {
"properties": {
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Albertid"
},
"name": {
"title": "Name",
"type": "string"
},
"datacolumnId": {
"title": "Datacolumnid",
"type": "string"
},
"datacolumnName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Datacolumnname"
},
"datatemplateId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Datatemplateid"
},
"datatemplateName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Datatemplatename"
},
"unitId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Unitid"
},
"unitName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Unitname"
},
"workflowId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Workflowid"
},
"workflowName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Workflowname"
},
"specConfig": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Specconfig"
},
"Value": {
"anyOf": [
{
"$ref": "#/$defs/InventorySpecValue"
},
{
"type": "null"
}
],
"default": null
}
},
"required": [
"name",
"datacolumnId"
],
"title": "InventorySpec",
"type": "object"
},
"InventorySpecValue": {
"properties": {
"min": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Min"
},
"max": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Max"
},
"reference": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Reference"
},
"comparisonOperator": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Comparisonoperator"
}
},
"title": "InventorySpecValue",
"type": "object"
}
},
"properties": {
"parentId": {
"title": "Parentid",
"type": "string"
},
"Specs": {
"items": {
"$ref": "#/$defs/InventorySpec"
},
"title": "Specs",
"type": "array"
}
},
"required": [
"parentId",
"Specs"
],
"title": "InventorySpecList",
"type": "object"
}
Fields:
-
parent_id
(str
) -
specs
(list[InventorySpec]
)
InventorySearchPictogramItem
Bases: BaseAlbertModel
Show JSON schema:
{
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"name": {
"title": "Name",
"type": "string"
},
"status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Status"
}
},
"required": [
"id",
"name"
],
"title": "InventorySearchPictogramItem",
"type": "object"
}
Fields:
InventorySearchSDSItem
Bases: BaseAlbertModel
Show JSON schema:
{
"properties": {
"unNumber": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Unnumber"
},
"storageClassName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Storageclassname"
},
"shippingDescription": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Shippingdescription"
},
"storageClassNumber": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Storageclassnumber"
},
"unClassification": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Unclassification"
}
},
"title": "InventorySearchSDSItem",
"type": "object"
}
Fields:
-
un_number
(str | None
) -
storage_class_name
(str | None
) -
shipping_description
(str | None
) -
storage_class_number
(str | None
) -
un_classification
(str | None
)
InventorySearchItem
Bases: BaseAlbertModel
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"
},
"InventoryCategory": {
"enum": [
"RawMaterials",
"Consumables",
"Equipment",
"Formulas"
],
"title": "InventoryCategory",
"type": "string"
},
"InventorySearchPictogramItem": {
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"name": {
"title": "Name",
"type": "string"
},
"status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Status"
}
},
"required": [
"id",
"name"
],
"title": "InventorySearchPictogramItem",
"type": "object"
},
"InventorySearchSDSItem": {
"properties": {
"unNumber": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Unnumber"
},
"storageClassName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Storageclassname"
},
"shippingDescription": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Shippingdescription"
},
"storageClassNumber": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Storageclassnumber"
},
"unClassification": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Unclassification"
}
},
"title": "InventorySearchSDSItem",
"type": "object"
},
"InventoryUnitCategory": {
"enum": [
"mass",
"volume",
"length",
"pressure",
"units"
],
"title": "InventoryUnitCategory",
"type": "string"
},
"Status": {
"description": "The status of a resource",
"enum": [
"active",
"inactive"
],
"title": "Status",
"type": "string"
},
"Tag": {
"description": "Tag is a Pydantic model representing a tag entity.\n\nAttributes\n----------\ntag : str\n The name of the tag.\nid : str | None\n The Albert ID of the tag. Set when the tag is retrieved from Albert.\n\nMethods\n-------\nfrom_string(tag: str) -> \"Tag\"\n Creates a Tag object from a string.",
"properties": {
"status": {
"anyOf": [
{
"$ref": "#/$defs/Status"
},
{
"type": "null"
}
],
"default": null
},
"Created": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null
},
"Updated": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null
},
"name": {
"title": "Name",
"type": "string"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Albertid"
}
},
"required": [
"name"
],
"title": "Tag",
"type": "object"
}
},
"properties": {
"albertId": {
"title": "Albertid",
"type": "string"
},
"name": {
"default": "",
"title": "Name",
"type": "string"
},
"description": {
"default": "",
"title": "Description",
"type": "string"
},
"category": {
"$ref": "#/$defs/InventoryCategory"
},
"unit": {
"$ref": "#/$defs/InventoryUnitCategory"
},
"lots": {
"items": {
"additionalProperties": true,
"type": "object"
},
"title": "Lots",
"type": "array"
},
"tags": {
"items": {
"$ref": "#/$defs/Tag"
},
"title": "Tags",
"type": "array"
},
"pictogram": {
"items": {
"$ref": "#/$defs/InventorySearchPictogramItem"
},
"title": "Pictogram",
"type": "array"
},
"inventoryOnHand": {
"default": 0.0,
"title": "Inventoryonhand",
"type": "number"
},
"SDS": {
"anyOf": [
{
"$ref": "#/$defs/InventorySearchSDSItem"
},
{
"type": "null"
}
],
"default": null
}
},
"required": [
"albertId",
"category",
"unit"
],
"title": "InventorySearchItem",
"type": "object"
}
Fields:
-
id
(str
) -
name
(str
) -
description
(str
) -
category
(InventoryCategory
) -
unit
(InventoryUnitCategory
) -
lots
(list[dict[str, Any]]
) -
tags
(list[Tag]
) -
pictogram
(list[InventorySearchPictogramItem]
) -
inventory_on_hand
(float
) -
sds
(InventorySearchSDSItem | None
)
MergeInventory
Bases: BaseAlbertModel
Show JSON schema:
{
"properties": {
"parentId": {
"title": "Parentid",
"type": "string"
},
"ChildInventories": {
"items": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"title": "Childinventories",
"type": "array"
},
"modules": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Modules"
}
},
"required": [
"parentId",
"ChildInventories"
],
"title": "MergeInventory",
"type": "object"
}
Fields:
-
parent_id
(InventoryId
) -
child_inventories
(list[dict[str, InventoryId]]
) -
modules
(list[str] | None
)