MechLab

A Modular Mechanical Engineering Laboratory for Python

MechLab is an open-source Python library for symbolic and numerical mechanical engineering computation. It provides a clean, engineering-focused API for stress analysis, unit conversions, thermodynamics, and interactive visualizations.

mechanics · thermodynamics · units · visualization · output · cli
Quick Example
from mechlab.mechanics import StressState
from mechlab.units import convert

# Stress analysis
state = StressState(100, 50, 25, unit="MPa")
s1, s2 = state.principal()
print(f"Principal stresses: {s1:.2f}, {s2:.2f} MPa")

# Unit conversion
psi = convert(100, 'MPa', 'psi')
print(f"100 MPa = {psi:.0f} psi")

Getting Started

Learning & Reference

Contribute & Explore