Skip to main content

Free open-source library of 30+ HSE (Health, Safety, Environment) calculators — TRIR, LTIR, LTIFR, DART, EMR, severity rate, WBGT heat stress, noise exposure, hand-arm vibration, REBA, RULA, NIOSH lifting, fire load, evacuation time, risk matrix. Pure Python 3.11+, zero runtime dependencies, regulation-cited (OSHA, HSE UK, ISO 45001, ILO, NIOSH, ACGIH).

Project description

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.

PyPI version Python versions License Tests Live demo

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smartqhse_hse_calculators-0.1.0.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

smartqhse_hse_calculators-0.1.0-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

Details for the file smartqhse_hse_calculators-0.1.0.tar.gz.

File metadata

File hashes

Hashes for smartqhse_hse_calculators-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f6566f9f98c821c49c7c9bc60a398d5baadcd2f321d0e6a51c022a84f60c885f
MD5 c8a3c7bf8b96ddb13ab87b2a51d17037
BLAKE2b-256 db8a14f7d8b6a8ad1bad6beaffc1458bae1739700ede7191fdeec849243dd60c

See more details on using hashes here.

Provenance

The following attestation bundles were made for smartqhse_hse_calculators-0.1.0.tar.gz:

Publisher: publish.yml on SmartQHSE/hse-calculators-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file smartqhse_hse_calculators-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for smartqhse_hse_calculators-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 45913cd7a37f0b3f915ad5eaf36e5daf186286a8b069a8e9b933a07ffb57704b
MD5 012283fdbf1f8d3cb0f535247f533ef0
BLAKE2b-256 92ee2fdf7524a02112d099dfd011e9afbb6978df903fcdf0c3bdd0e4d0e49d65

See more details on using hashes here.

Provenance

The following attestation bundles were made for smartqhse_hse_calculators-0.1.0-py3-none-any.whl:

Publisher: publish.yml on SmartQHSE/hse-calculators-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page