openpyxl.preserve.saver
paper-xlsx 0.2.1 API reference
Save dispatch target for preserve-mode workbooks.
Ordered-stream splice: untouched parts raw-copy from the retained bytes (byte-identical by construction); touched worksheet parts are spliced; cross-part edits (new sheets, styles append, calcChain cascade, workbook.xml elements, hyperlink relationships, content types) are targeted byte edits against the original payloads. Everything is validated BEFORE the first output byte, so every refusal is atomic.
Still refused in v0 (typed, never silent): comment changes on loaded sheets;
table add/remove; charts/images/comments/tables on ADDED sheets (partially
deferred); custom-property part creation; workbook.xml
elements outside {sheets, definedNames, calcPr, bookViews}; chartsheet
changes; unsupported edits to preserved object parts.
save_preserved
funcsave_preserved(workbook, target, *, allow_formula_loss=False)Plan and deliver without retaining serializer side effects.
paramworkbookparamtargetparamallow_formula_loss= Falsevalidate_preserved
funcvalidate_preserved(workbook, *, allow_formula_loss=False)Run the exact preserve save planner without assembling an archive.
Serializer helpers used during planning can mutate model registries, so validation uses the same planning-state guard as delivery and restores the workbook before returning or raising.
paramworkbookopenpyxl.workbook.workbook.WorkbookPreserve-mode workbook to validate.
paramallow_formula_lossbool= FalseAllow edited cached values to replace formulas.
Returns
NoneNone.