STEL
This function retrieves the short-term exposure limit (STEL) for a chemical identified by CAS Registry Number. STEL values represent allowable concentration over a short averaging window used in occupational health constraints.
Results are returned as JSON with value and units. When both ppm and mg/m^3 are available in the source, the ppm value is preferred by the wrapped library.
Excel Usage
=STEL(CASRN, method)
CASRN(str, required): Chemical Abstracts Service Registry Number identifier (-).method(str, optional, default: null): Source method name used for STEL lookup (-).
Returns (str): JSON string containing value and units.
Example 1: Acetone STEL
Inputs:
| CASRN |
|---|
| 67-64-1 |
Excel formula:
=STEL("67-64-1")
Expected output:
"{\"value\": 750.0, \"units\": \"ppm\"}"
Example 2: Phosphoric acid STEL
Inputs:
| CASRN |
|---|
| 7664-38-2 |
Excel formula:
=STEL("7664-38-2")
Expected output:
"{\"value\": 0.7489774978301237, \"units\": \"ppm\"}"
Example 3: Chlorinated compound STEL
Inputs:
| CASRN |
|---|
| 55720-99-5 |
Excel formula:
=STEL("55720-99-5")
Expected output:
"{\"value\": 2.0, \"units\": \"mg/m^3\"}"
Example 4: Acetone STEL with null method
Inputs:
| CASRN | method |
|---|---|
| 67-64-1 |
Excel formula:
=STEL("67-64-1", )
Expected output:
"{\"value\": 750.0, \"units\": \"ppm\"}"
Python Code
Show Code
import json
from chemicals.safety import STEL
def stel(CASRN, method=None):
"""
Handles the retrieval of Short-term Exposure Limit (STEL) for worker exposure.
See: https://chemicals.readthedocs.io/chemicals.safety.html
This example function is provided as-is without any representation of accuracy.
Args:
CASRN (str): Chemical Abstracts Service Registry Number identifier (-).
method (str, optional): Source method name used for STEL lookup (-). Default is None.
Returns:
str: JSON string containing value and units.
"""
try:
res = STEL(CASRN, method=method)
if res is None:
return "Error: Data not available"
return json.dumps({"value": res[0], "units": res[1]})
except Exception as e:
return f"Error: {str(e)}"