This free tool generates ready-to-run Python scripts for common engineering calculations. Select a category and script type, fill in your parameters, and click Generate Script. The output is real, working Python code — not pseudocode — that you can copy or download as a .py file and run immediately. Scripts include proper docstrings, inline code comments citing applicable codes and standards, and a working example usage block.
Load Calculations — NEC 220.82 Optional Method residential service load, NEC 220.87 demand load, motor branch circuit (NEC Article 430), and panel schedule load summary using pandas.
Unit Conversions — Comprehensive electrical unit libraries (kW/kVA/HP, dBm/mW, AWG/mm²), HVAC unit libraries (BTU/hr/kW/tons, CFM/L/s, PSI/Pa), structural unit libraries (kips/kN, psf/kPa, MPa/ksi), and Hazen-Williams pipe flow conversion.
Data Processing — Sensor data logger parser (resample + aggregate), energy data analyzer (kWh/month + peak detection), equipment runtime tracker (cycle counting), and multi-channel CSV merger.
Chart Generation — Electrical load profile (line/bar/stepped), HVAC performance scatter with regression, structural shear/moment diagram, and multi-subplot time-series dashboard.
Report Automation — Excel calc summary (openpyxl with header + table + PE block), PDF report (reportlab), Word document (python-docx), and HTML email sender (smtplib).
Structural Calcs — AISC 360-22 steel beam moment capacity, ACI 318-19 concrete beam flexure, AISC 360-22 column buckling, and Terzaghi foundation bearing capacity.
Requirements by category: • Load Calculations: Standard library only — no pip install needed. • Unit Conversions: Standard library only. • Data Processing: pip install pandas • Chart Generation: pip install matplotlib scipy • Report Automation: pip install openpyxl reportlab python-docx • Structural Calcs: pip install numpy
To run: Save the .py file, open a terminal, and run: python filename.py
To run in Jupyter: Paste the code into a cell and run it. You can use %matplotlib inline for charts to display inline.
All generated scripts include the required pip install commands in the module docstring so you know exactly what to install.
Electrical: NEC 2023 (NFPA 70) — load calculation methods per Articles 220, 230, 430, and 440. Demand factors, optional method thresholds, and service sizing per 230.79.
Structural steel: AISC 360-22 Specification for Structural Steel Buildings — Chapter F (flexural members), Chapter E (members subject to compression), compact/noncompact section classification per Table B4.1b.
Structural concrete: ACI 318-19 Building Code Requirements for Structural Concrete — Section 22.2 (flexural strength), Whitney rectangular stress block, φ factors per Table 21.2.2.
Foundations: Terzaghi bearing capacity equation (general shear failure) for square footings — Nc, Nq, Nγ bearing capacity factors from standard references.
The generated scripts are standard Python code you can modify freely. Common customizations:
Change input source: Replace hardcoded parameter values at the top of the script with: values = pd.read_csv('input.csv') or argparse for command-line arguments.
Add more load types: For NEC load scripts, add additional load rows to the loads dictionary and include them in the demand factor logic.
Change output format: Redirect print() output to a file with: with open('output.txt', 'w') as f: print(..., file=f)
Batch processing: Wrap the main calculation function in a for loop to process multiple projects: for project in projects: result = calc_function(**project)
Unit flexibility: Add a units parameter ('imperial' or 'metric') and a conversion block at the top to support both unit systems.
Load Calculations and Unit Conversions use only the standard library (no install needed). Data Processing needs pandas. Chart Generation needs matplotlib and scipy. Report Automation needs openpyxl, reportlab, or python-docx depending on output type. Structural Calcs need numpy. Each generated script lists the pip install command in its docstring.
Download the .py file, open a terminal, navigate to the file directory, and run: python filename.py. Install any missing packages with pip install package_name. Data processing scripts expect a CSV in the same directory — update the filename variable at the top. Chart scripts save PNG output to the current directory.
The NEC 220.82 Optional Method scripts implement the applicable code formulas accurately for standard residential applications and should be reviewed by a licensed electrical engineer before use in construction documents. Scripts include comments citing the specific NEC code sections for each calculation step.
Yes — the code is standard Python you can edit freely. Common modifications: change input source from hardcoded values to CSV/Excel input, add load types, change output format, wrap in a for loop for batch processing, or add unit conversion options.
Steel beam scripts use AISC 360-22 LRFD with compact section check and lateral-torsional buckling. Column scripts use AISC 360-22 Chapter E with KL/r slenderness. Concrete beam scripts use ACI 318-19 strength design with the rectangular stress block. Foundation scripts use Terzaghi bearing capacity for square footings.