Excel Writer¶
excel_model.excel_writer
¶
Orchestrator: build_workbook() — creates the full Excel workbook.
build_workbook(spec, inputs, output_path, style)
¶
Build and save a complete Excel workbook from the model spec.
Creates Assumptions, Inputs, and Model sheets. Dispatches to the appropriate model builder based on spec.model_type.
Security: output_path is trusted. Its parent directories are created
with mkdir(parents=True) and the file is written without any containment
check, so passing an attacker-controlled path lets the caller create
arbitrary directory trees and overwrite arbitrary files. Callers must
validate output_path (e.g. confirm it resolves within an allowed base
directory) before invoking this function from any untrusted or networked
context.
Source code in excel_model/excel_writer.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |