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 CAS numbers that cannot be resolved. When True, such errors are absorbed and those substances are simply omitted from the result, so fewer substances may be returned than CAS numbers requested. When None (default), the server default applies. |
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 CAS number that cannot be resolved. When True, the error is absorbed and None is returned instead. When None (default), the server default applies. |
None
|
Returns:
| Type | Description |
|---|---|
SubstanceInfo or None
|
The fully populated substance, or None if it is not found. |