Skip to content

Cas

albert.resources.cas

CasCategory

Bases: str, Enum

Attributes:

Name Type Description
USER
VERISK
TSCA_PUBLIC
TSCA_PRIVATE
NOT_TSCA
EXTERNAL
UNKNOWN
CL_INVENTORY_UPLOAD

USER

USER = 'User'

VERISK

VERISK = 'Verisk'

TSCA_PUBLIC

TSCA_PUBLIC = 'TSCA - Public'

TSCA_PRIVATE

TSCA_PRIVATE = 'TSCA - Private'

NOT_TSCA

NOT_TSCA = 'not TSCA'

EXTERNAL

EXTERNAL = 'CAS linked to External Database'

UNKNOWN

UNKNOWN = 'Unknown (Trade Secret)'

CL_INVENTORY_UPLOAD

CL_INVENTORY_UPLOAD = 'CL_Inventory Upload'

Hazard

Bases: BaseAlbertModel

Represents a chemical hazard.

Show JSON schema:
{
  "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"
}

Fields:

sub_category

sub_category: str | None = None

Hazard subcategory

h_code

h_code: str | None = None

Hazard code

category

category: str | float | None = None

Hazard category

hazard_class

hazard_class: str | None = None

Hazard classification

h_code_text

h_code_text: str | None = None

Hazard code text

Cas

Bases: BaseResource

Represents a CAS entity.

Methods:

Name Description
from_string

Creates a Cas object from a string.

Attributes:

Name Type Description
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]

number

number: str = Field(..., description='The CAS number.')

name

name: str | None = Field(
    None, description="Name of the CAS."
)

description

description: str | None = Field(
    None, description="The description or name of the CAS."
)

notes

notes: str | None = Field(
    None, description="Notes related to the CAS."
)

category

category: CasCategory | None = Field(
    None, description="The category of the CAS."
)

smiles

smiles: str | None = Field(
    None,
    alias="casSmiles",
    description="CAS SMILES notation.",
)

inchi_key

inchi_key: str | None = Field(
    None,
    alias="inchiKey",
    description="InChIKey of the CAS.",
)

iupac_name

iupac_name: str | None = Field(
    None,
    alias="iUpacName",
    description="IUPAC name of the CAS.",
)

id

id: str | None = Field(
    None,
    alias="albertId",
    description="The AlbertID of the CAS.",
)

hazards

hazards: list[Hazard] | None = Field(
    None, description="Hazards associated with the CAS."
)

wgk

wgk: str | None = Field(
    None,
    description="German Water Hazard Class (WGK) number.",
)

ec_number

ec_number: str | None = Field(
    None,
    alias="ecListNo",
    description="European Community (EC) number.",
)

type

type: str | None = Field(
    None, description="Type of the CAS."
)

classification_type

classification_type: str | None = Field(
    None,
    alias="classificationType",
    description="Classification type of the CAS.",
)

order

order: str | None = Field(None, description='CAS order.')

metadata

metadata: dict[str, MetadataItem] = Field(
    alias="Metadata", default_factory=dict
)

from_string

from_string(*, number: str) -> Cas

Creates a Cas object from a string.

Parameters:

Name Type Description Default
number str

The CAS number.

required

Returns:

Type Description
Cas

The Cas object created from the string.

Source code in src/albert/resources/cas.py
@classmethod
def from_string(cls, *, number: str) -> "Cas":
    """
    Creates a Cas object from a string.

    Parameters
    ----------
    number : str
        The CAS number.

    Returns
    -------
    Cas
        The Cas object created from the string.
    """
    return cls(number=number)