smartqhse-hse-calculators (Python)
30+ health, safety & environment (HSE) calculators — TRIR, LTIR, LTIFR, DART, EMR, severity rate, heat stress (WBGT), noise exposure, hand-arm vibration, ergonomics (REBA, RULA, NIOSH), fire load, evacuation time, manhours, risk matrix, incident cost, and more. Pure Python 3.11+, zero runtime dependencies, MIT licensed.
The Python port of @smartqhse/hse-calculators (TypeScript). Same formulas, same authoritative citations, Python-native API with type hints and dataclasses / TypedDicts.
🌐 Live calculators: tools.smartqhse.com 🏗️ Full HSE platform: smartqhse.com — AI-powered permits, risk assessments, incidents, audits, ISO 45001 compliance.
Installation
pip install smartqhse-hse-calculators
Zero runtime dependencies. Python 3.11+.
Quick start
from smartqhse_hse_calculators import (
calculate_trir,
calculate_ltifr,
calculate_wbgt,
calculate_risk_matrix,
)
# TRIR — OSHA Total Recordable Incident Rate
trir = calculate_trir(recordable_incidents=3, hours_worked=500_000)
print(trir.rate) # 1.2
print(trir.base) # 200_000
# LTIFR — ISO/ILO Lost Time Injury Frequency Rate
ltifr = calculate_ltifr(lost_time_injuries=3, hours_worked=500_000)
print(ltifr.rate) # 6.0
# WBGT heat stress (ACGIH TLV / ISO 7243)
heat = calculate_wbgt(temp_c=38, humidity=60, globe_temp_c=42, indoor=False)
print(heat["risk_level"]) # 'high' or 'extreme'
print(heat["acgih_work_rest_ratio"]) # '25/75' or 'Stop work'
# 5×5 Risk matrix (oil & gas standard)
risk = calculate_risk_matrix(likelihood=4, severity=5, matrix="5x5")
print(risk["band"]) # 'extreme'
print(risk["action"]) # 'Intolerable — stop work, escalate to leadership'
Available calculators
Incident rate formulas
| Function | Measures | Base | Regulation |
|---|---|---|---|
calculate_trir |
Total Recordable Incident Rate (OSHA) | 200,000 | 29 CFR 1904.7 |
calculate_ltir |
Lost Time Incident Rate (OSHA) | 200,000 | 29 CFR 1904.7(b)(3) |
calculate_ltifr |
Lost Time Injury Frequency Rate (ISO/ILO) | 1,000,000 | ILO / ISO 45001:2018 |
calculate_dart |
Days Away, Restricted, Transferred | 200,000 | 29 CFR 1904.7(a) |
calculate_severity_rate |
Days lost per exposure base | 200k / 1M | OSHA / ILO |
calculate_frequency_rate |
International accident frequency | 1,000,000 | HSE UK / IOGP |
calculate_emr |
Workers comp Experience Modification Rate | — | NCCI |
calculate_incident_cost |
OSHA $afety Pays direct + indirect | — | OSHA |
calculate_heinrich_ratio |
Near-miss pyramid ratios | — | Heinrich / Bird |
calculate_safe_days |
Days since last recordable | — | — |
calculate_working_days_lost |
ISO 45001 Clause 9.1 days-lost KPI | — | ISO 45001 |
Occupational exposure
| Function | Measures | Regulation |
|---|---|---|
calculate_noise_dose |
Daily noise dose + 8-hr TWA | OSHA 29 CFR 1910.95 |
calculate_noise_exposure |
Multi-segment TWA | OSHA / ACGIH |
calculate_hav |
Hand-Arm Vibration A(8) | HSE UK L140 / ISO 5349 |
calculate_wbv |
Whole-Body Vibration A(8) | ISO 2631-1 / EU 2002/44/EC |
calculate_coshh_risk_score |
COSHH control banding | HSE UK COSHH Essentials |
Environmental
| Function | Measures | Regulation |
|---|---|---|
calculate_wbgt |
Wet Bulb Globe Temperature | ACGIH TLV / ISO 7243 |
calculate_heat_index |
NWS heat index ("feels like") | NWS / OSHA |
calculate_lux_level |
Workplace illuminance | CIBSE / EN 12464-1 |
calculate_ventilation |
Ventilation rate (ACH) | ASHRAE 62.1 |
calculate_carbon_footprint |
Scope 1+2+3 CO₂e | GHG Protocol / ISO 14064-1 |
Ergonomics
| Function | Measures | Source |
|---|---|---|
calculate_niosh_lift |
Recommended Weight Limit + Lifting Index | NIOSH 94-110 |
calculate_reba |
Rapid Entire Body Assessment (1-15) | Hignett & McAtamney 2000 |
calculate_rula |
Rapid Upper Limb Assessment (1-7) | McAtamney & Corlett 1993 |
calculate_manual_handling |
HSE UK MAC risk banding | HSE UK MAC tool |
Fire safety
| Function | Measures | Source |
|---|---|---|
calculate_fire_load |
Fire load density (MJ/m²) | NFPA 557 / BS 9999 |
calculate_evacuation_time |
RSET (Required Safe Egress Time) | NFPA 101 / BS 9999 |
calculate_fire_extinguisher_size |
Min rating + count | NFPA 10 / BS 5306 |
Workload & risk
| Function | Measures |
|---|---|
calculate_manhours |
Total exposure hours with overtime |
calculate_fte |
Full-time equivalent workers |
calculate_risk_matrix |
5×5 or 4×4 matrix scoring |
calculate_risk_reduction |
Pre/post residual reduction |
calculate_safety_score |
Composite 0-100 HSE KPI (A-F grade) |
calculate_stress_risk |
HSE UK Management Standards |
Type safety
Every function has type hints. Result types are @dataclass(frozen=True) or TypedDict. Works with mypy --strict.
from smartqhse_hse_calculators.incident_rates import RateResult
result: RateResult = calculate_trir(recordable_incidents=3, hours_worked=500_000)
# result.rate → float
# result.base → int
# result.formula → str
Regulation citations
Every formula is rooted in a published regulation or peer-reviewed ergonomic standard. No proprietary calculations, no "SmartQHSE recommends" values.
United States
- 29 CFR 1904.7 — OSHA recordability (TRIR, LTIR, DART)
- 29 CFR 1910.95 — OSHA occupational noise
- NIOSH Publication 94-110 — Revised lifting equation
- NFPA 10, 101, 557 — Fire codes
- ASHRAE 62.1 — Ventilation
- NCCI — Workers comp EMR
United Kingdom
- HSE L140 — Hand-arm vibration
- HSE MAC tool — Manual handling
- BS 5306, BS 9999 — Fire safety
- HSE Stress Management Standards
International
- ISO 45001:2018 — OH&S management systems
- ISO 14064-1 — GHG quantification
- ISO 2631-1 — Whole-body vibration
- ISO 7243 — WBGT heat stress
- ILO — Frequency rate standards
Europe
- EU Directive 2003/10/EC — Noise
- EU Directive 2002/44/EC — Vibration
- EN 12464-1 — Workplace lighting
Professional bodies
- ACGIH TLVs® — Threshold Limit Values
- GHG Protocol — Scope 1/2/3 accounting
- IOGP — Oil & gas safety benchmarks
- NIOSH — National Institute for Occupational Safety and Health
Who uses this library
- Data scientists doing safety analytics in pandas / Jupyter
- Safety researchers running statistical analyses on HSE datasets
- Academic institutions teaching occupational health and safety
- Government agencies analysing workplace safety trends
- EHS software vendors embedding standardised calculations
- Consultants producing client reports with auditable formulas
- Industrial hygienists quantifying exposure
Full platform
SmartQHSE is the AI-powered HSE / QHSE management platform built on top of these calculators — permits, AI-generated risk assessments, incident management, contractor prequalification, ISO 45001 compliance dashboards.
License
MIT © SmartQHSE Ltd
Related
- TypeScript version:
@smartqhse/hse-calculators - Live web UI: tools.smartqhse.com
- HSE Benchmarks 2026 open dataset: smartqhse.com/datasets/hse-benchmarks-2026
- Awesome HSE: github.com/SmartQHSE/awesome-hse
- HSE knowledge base: smartqhse.com/answers
Release files for smartqhse-hse-calculators 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| smartqhse_hse_calculators-0.1.0.tar.gz | 19.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| smartqhse_hse_calculators-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 39.6 kB
Release files / smartqhse_hse_calculators-0.1.0.tar.gz
| Download URL | smartqhse_hse_calculators-0.1.0.tar.gz |
|---|---|
| Size | 19.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f6566f9f98c821c49c7c9bc60a398d5baadcd2f321d0e6a51c022a84f60c885f
|
|
BLAKE2b-256 checksum How to use checksums |
db8a14f7d8b6a8ad1bad6beaffc1458bae1739700ede7191fdeec849243dd60c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 23, 2026.
Transparency logRelease files / smartqhse_hse_calculators-0.1.0-py3-none-any.whl
| Download URL | smartqhse_hse_calculators-0.1.0-py3-none-any.whl |
|---|---|
| Size | 20.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
45913cd7a37f0b3f915ad5eaf36e5daf186286a8b069a8e9b933a07ffb57704b
|
|
BLAKE2b-256 checksum How to use checksums |
92ee2fdf7524a02112d099dfd011e9afbb6978df903fcdf0c3bdd0e4d0e49d65
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 23, 2026.
Transparency log