Skip to content

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

Bases: str, Enum

Attributes:

Name Type Description
RAW_MATERIALS
CONSUMABLES
EQUIPMENT
FORMULAS

RAW_MATERIALS

RAW_MATERIALS = 'RawMaterials'

CONSUMABLES

CONSUMABLES = 'Consumables'

EQUIPMENT

EQUIPMENT = 'Equipment'

FORMULAS

FORMULAS = 'Formulas'

InventoryUnitCategory

Bases: str, Enum

Attributes:

Name Type Description
MASS
VOLUME
LENGTH
PRESSURE
UNITS

MASS

MASS = 'mass'

VOLUME

VOLUME = 'volume'

LENGTH

LENGTH = 'length'

PRESSURE

PRESSURE = 'pressure'

UNITS

UNITS = 'units'

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:

Validators:

min

min: float

max

max: float

target

target: float | None = None

id

id: str | None = None

cas_category

cas_category: str | None = None

cas

cas: Cas | None = None

cas_smiles

cas_smiles: str | None = None

number

number: str | None = None

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
@model_validator(mode="after")
def set_cas_attributes(self: "CasAmount") -> "CasAmount":
    """Set attributes after model initialization from the Cas object, if provided."""
    if self.cas is not None:
        object.__setattr__(self, "id", self.cas.id)
        object.__setattr__(self, "cas_smiles", self.cas.smiles)
        object.__setattr__(self, "number", self.cas.number)
    return self

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:

id

id: str | None = None

location

location: Location | None = None

minimum

minimum: float

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
@model_validator(mode="after")
def check_id_or_location(self: "InventoryMinimum") -> "InventoryMinimum":
    """
    Ensure that either an id or a location is provided.
    """
    if self.id is None and self.location is None:
        raise ValueError(
            "Either an id or a location must be provided for an InventoryMinimum."
        )
    if self.id and self.location and self.location.id != self.id:
        raise ValueError(
            "Only an id or a location can be provided for an InventoryMinimum, not both."
        )

    elif self.location:
        # Avoid recursion by setting the attribute directly
        object.__setattr__(self, "id", self.location.id)
        object.__setattr__(self, "name", self.location.name)

    return self

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 RawMaterials, Consumables, Equipment, and Formulas.

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:

Validators:

name

name: str | None = None

id

id: str | None = None

description

description: str | None = None

category

unit_category

unit_category: InventoryUnitCategory | None = None

security_class

security_class: SecurityClass | None = None

company

company: SerializeAsEntityLink[Company] | None = None

minimum

minimum: list[InventoryMinimum] | None = None

alias

alias: str | None = None

cas

cas: list[CasAmount] | None = None

metadata

metadata: dict[str, MetadataItem] | None = None

project_id

project_id: str | None = None

acls

acls: list[ACL]

task_config

task_config: list[dict] | None = None

formula_id

formula_id: str | None = None

symbols

symbols: list[dict] | None = None

un_number

un_number: str | None = None

recent_atachment_id

recent_atachment_id: str | None = None

validate_company_string

validate_company_string(value: Any) -> Any
Source code in src/albert/resources/inventory.py
@field_validator("company", mode="before")
@classmethod
def validate_company_string(cls, value: Any) -> Any:
    if isinstance(value, str):
        value = Company(name=value)
    return value

validate_un_number

validate_un_number(value: Any) -> Any
Source code in src/albert/resources/inventory.py
@field_validator("un_number", mode="before")
@classmethod
def validate_un_number(cls, value: Any) -> Any:
    if value == "N/A":
        value = None
    return value

set_unit_category

set_unit_category() -> InventoryItem

Set unit category from category if not defined.

Source code in src/albert/resources/inventory.py
@model_validator(mode="after")
def set_unit_category(self) -> "InventoryItem":
    """Set unit category from category if not defined."""
    if self.unit_category is None:
        if self.category in [InventoryCategory.RAW_MATERIALS, InventoryCategory.FORMULAS]:
            object.__setattr__(self, "unit_category", InventoryUnitCategory.MASS)
        elif self.category in [InventoryCategory.EQUIPMENT, InventoryCategory.CONSUMABLES]:
            object.__setattr__(self, "unit_category", InventoryUnitCategory.UNITS)
    return self

validate_formula_fields

validate_formula_fields() -> InventoryItem

Ensure required fields are present for formulas.

Source code in src/albert/resources/inventory.py
@model_validator(mode="after")
def validate_formula_fields(self) -> "InventoryItem":
    """Ensure required fields are present for formulas."""
    if self.category == InventoryCategory.FORMULAS and not self.project_id and not self.id:
        # Some legacy on platform formulas don't have a project_id so check if its already on platform
        raise ValueError("A project_id must be supplied for all formulas.")
    return self

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:

min

min: str | None = None

max

max: str | None = None

reference

reference: str | None = None

comparison_operator

comparison_operator: str | None = None

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

id: str | None = None

name

name: str

data_column_id

data_column_id: str

data_column_name

data_column_name: str | None = None

data_template_id

data_template_id: str | None = None

data_template_name

data_template_name: str | None = None

unit_id

unit_id: str | None = None

unit_name

unit_name: str | None = None

workflow_id

workflow_id: str | None = None

workflow_name

workflow_name: str | None = None

spec_config

spec_config: str | None = None

value

value: InventorySpecValue | None = 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

parent_id: str

specs

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:

id

id: str

name

name: str

status

status: str | None = None

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

un_number: str | None = None

storage_class_name

storage_class_name: str | None = None

shipping_description

shipping_description: str | None = None

storage_class_number

storage_class_number: str | None = None

un_classification

un_classification: str | None = 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

id: str

name

name: str = ''

description

description: str = ''

category

lots

lots: list[dict[str, Any]]

tags

tags: list[Tag]

pictogram

inventory_on_hand

inventory_on_hand: float = 0.0

sds

sds: InventorySearchSDSItem | None = 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

parent_id: InventoryId

child_inventories

child_inventories: list[dict[str, InventoryId]]

modules

modules: list[str] | None = None