Cas
albert.resources.cas
CasCategory
Attributes:
| Name | Type | Description |
|---|---|---|
USER |
|
|
VERISK |
|
|
TSCA_PUBLIC |
|
|
TSCA_PRIVATE |
|
|
NOT_TSCA |
|
|
EXTERNAL |
|
|
UNKNOWN |
|
|
CL_INVENTORY_UPLOAD |
|
Hazard
Bases: BaseAlbertModel
A single GHS hazard classification associated with a CAS substance.
Hazards are read from the CAS record; a Cas may carry a list of them.
Show JSON schema:
{
"description": "A single GHS hazard classification associated with a CAS substance.\n\nHazards are read from the CAS record; a [`Cas`][albert.resources.cas.Cas] may carry a list of them.",
"properties": {
"subCategory": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Hazard subcategory",
"title": "Subcategory"
},
"hCode": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Hazard code",
"title": "Hcode"
},
"category": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Hazard category",
"title": "Category"
},
"class": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Hazard classification",
"title": "Class"
},
"hCodeText": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Hazard code text",
"title": "Hcodetext"
}
},
"title": "Hazard",
"type": "object"
}
Fields:
-
sub_category(str | None) -
h_code(str | None) -
category(str | float | None) -
hazard_class(str | None) -
h_code_text(str | None)
Cas
Bases: BaseResource
A CAS entry: a chemical substance identified by its CAS Registry Number.
A Cas is Albert's dictionary record for a substance. Raw-material Inventory
Items reference these entries to declare what they are made of, pairing each
Cas with an amount (see CasAmount).
Manage entries through
CasCollection (client.cas): most fields
are populated by Albert, so you typically only build a Cas from a registry
number when creating a new entry.
Example
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"
},
"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"
},
"EntityLink": {
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"category": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Category"
}
},
"required": [
"id"
],
"title": "EntityLink",
"type": "object"
},
"EntityLinkWithName": {
"description": "EntityLink that includes the name field in serialization.",
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"category": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Category"
}
},
"required": [
"id"
],
"title": "EntityLinkWithName",
"type": "object"
},
"Hazard": {
"description": "A single GHS hazard classification associated with a CAS substance.\n\nHazards are read from the CAS record; a [`Cas`][albert.resources.cas.Cas] may carry a list of them.",
"properties": {
"subCategory": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Hazard subcategory",
"title": "Subcategory"
},
"hCode": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Hazard code",
"title": "Hcode"
},
"category": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Hazard category",
"title": "Category"
},
"class": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Hazard classification",
"title": "Class"
},
"hCodeText": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Hazard code text",
"title": "Hcodetext"
}
},
"title": "Hazard",
"type": "object"
},
"Status": {
"description": "The status of a resource.\n\nAttributes\n----------\nACTIVE : str\n The resource is fully operational and visible in normal operations.\nINACTIVE : str\n The resource is hidden from normal operations and disabled from use.",
"enum": [
"active",
"inactive"
],
"title": "Status",
"type": "string"
}
},
"description": "A CAS entry: a chemical substance identified by its CAS Registry Number.\n\nA ``Cas`` is Albert's dictionary record for a substance. Raw-material Inventory\nItems reference these entries to declare what they are made of, pairing each\n``Cas`` with an amount (see [`CasAmount`][albert.resources.inventory.CasAmount]).\nManage entries through\n[`CasCollection`][albert.collections.cas.CasCollection] (``client.cas``): most fields\nare populated by Albert, so you typically only build a ``Cas`` from a registry\n``number`` when creating a new entry.\n\n!!! example\n ```python\n from albert.resources.cas import Cas\n # Build a CAS entry to register a new substance\n cas = Cas(number=\"7727-37-9\")\n ```",
"properties": {
"status": {
"anyOf": [
{
"$ref": "#/$defs/Status"
},
{
"type": "null"
}
],
"default": null,
"description": "The status of the resource, optional."
},
"Created": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null,
"description": "Audit fields for the creation of the resource, optional."
},
"Updated": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null,
"description": "Audit fields for the update of the resource, optional."
},
"number": {
"description": "The CAS number.",
"title": "Number",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Name of the CAS.",
"title": "Name"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The description or name of the CAS.",
"title": "Description"
},
"notes": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Notes related to the CAS.",
"title": "Notes"
},
"category": {
"anyOf": [
{
"$ref": "#/$defs/CasCategory"
},
{
"type": "null"
}
],
"default": null,
"description": "The category of the CAS."
},
"casSmiles": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "CAS SMILES notation.",
"title": "Cassmiles"
},
"inchiKey": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "InChIKey of the CAS.",
"title": "Inchikey"
},
"iUpacName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "IUPAC name of the CAS.",
"title": "Iupacname"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The AlbertID of the CAS.",
"title": "Albertid"
},
"hazards": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/Hazard"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Hazards associated with the CAS.",
"title": "Hazards"
},
"wgk": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "German Water Hazard Class (WGK) number.",
"title": "Wgk"
},
"ecListNo": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "European Community (EC) number.",
"title": "Eclistno"
},
"type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Internal classification_type reference.",
"title": "Type"
},
"classificationType": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Classification type of the CAS.",
"title": "Classificationtype"
},
"order": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "CAS order.",
"title": "Order"
},
"Metadata": {
"additionalProperties": {
"anyOf": [
{
"type": "number"
},
{
"type": "integer"
},
{
"type": "string"
},
{
"$ref": "#/$defs/EntityLinkWithName"
},
{
"$ref": "#/$defs/EntityLink"
},
{
"items": {
"anyOf": [
{
"$ref": "#/$defs/EntityLinkWithName"
},
{
"$ref": "#/$defs/EntityLink"
}
]
},
"type": "array"
}
]
},
"description": "Custom metadata keyed by field. Updatable.",
"title": "Metadata",
"type": "object"
}
},
"required": [
"number"
],
"title": "Cas",
"type": "object"
}
Fields:
-
status(Status | None) -
created(AuditFields | None) -
updated(AuditFields | None) -
number(str) -
name(str | None) -
description(str | None) -
notes(str | None) -
category(CasCategory | None) -
smiles(str | None) -
inchi_key(str | None) -
iupac_name(str | None) -
id(str | None) -
hazards(list[Hazard] | None) -
wgk(str | None) -
ec_number(str | None) -
type(str | None) -
classification_type(str | None) -
order(str | None) -
metadata(dict[str, MetadataItem])
from_string
Build a Cas from a bare registry number.
Convenience constructor equivalent to Cas(number=number), for when you
only have the registry number and want a Cas object to pass to
CasCollection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
number
|
str
|
The CAS Registry Number (e.g. |
required |
Returns:
| Type | Description |
|---|---|
Cas
|
A |