Substances
albert.collections.substance.SubstanceCollection
Bases: BaseCollection
Look up regulatory and hazard information for chemical substances.
A Substance is the regulatory/compliance profile of a chemical, keyed by its
CAS number. Each SubstanceInfo bundles
the data Albert holds for that chemical, including GHS hazard
classifications, toxicity and ecotoxicity data, exposure limits, physical
properties, and membership on regulatory lists across many jurisdictions.
Results can be scoped to a region, since regulatory status varies by country.
Substances are read-only reference data: this collection only retrieves
information and does not create or modify it. They are addressed by CAS
number (e.g. "64-17-5") rather than by an Albert ID, and relate to
Cas records used elsewhere in the platform.
This collection is accessed as client.substances.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
AlbertSession
|
The authenticated Albert session used for API calls. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
base_path |
str
|
The base API route for substance requests. |
Methods:
| Name | Description |
|---|---|
get_by_ids |
Get regulatory information for several CAS numbers at once. |
get_by_id |
Get regulatory information for a single CAS number. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
AlbertSession
|
The authenticated Albert session used for API calls. |
required |
Source code in src/albert/collections/substance.py
get_by_ids
get_by_ids(
*,
cas_ids: list[str],
region: str = "US",
catch_errors: bool | None = None,
) -> list[SubstanceInfo]
Get regulatory information for several CAS numbers at once.
For a single CAS number, use get_by_id.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cas_ids
|
list[str]
|
The CAS numbers to retrieve substances for (e.g. |
required |
region
|
str
|
The region to scope regulatory status to. Defaults to |
'US'
|
catch_errors
|
bool
|
How to handle requested substances that are missing hazard data. When True, the request fails if any requested substance is missing hazard data. When False, such errors are absorbed and the affected substances are omitted from the result, so fewer substances may be returned than CAS numbers requested. When None (default), the server default applies. Only governs missing hazard data; it does not affect how unknown CAS numbers are handled. |
None
|
Returns:
| Type | Description |
|---|---|
list[SubstanceInfo]
|
The substances found for the given CAS numbers. |
Source code in src/albert/collections/substance.py
get_by_id
get_by_id(
*,
cas_id: str,
region: str = "US",
catch_errors: bool | None = None,
) -> SubstanceInfo | None
Get regulatory information for a single CAS number.
To look up several CAS numbers in one call, use get_by_ids.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cas_id
|
str
|
The CAS number of the substance to retrieve (e.g. |
required |
region
|
str
|
The region to scope regulatory status to. Defaults to |
'US'
|
catch_errors
|
bool
|
How to handle a substance that is missing hazard data. When True, the request fails if the substance is missing hazard data. When False, the error is absorbed and None is returned instead. When None (default), the server default applies. Only governs missing hazard data; it does not affect how unknown CAS numbers are handled. |
None
|
Returns:
| Type | Description |
|---|---|
SubstanceInfo or None
|
The fully populated substance, or None if it is not found. |