openpyxl.preserve.tables
paper-xlsx 0.2.1 API reference
Loaded-table mutation, and the table row discipline.
Table parts are fully modeled upstream (Table is Serialisable end to end), so a mutated table re-renders whole from the model — located by displayName in the ORIGINAL sheet rels, never by guessed part numbering. Guards refuse geometry the discipline cannot keep coherent: the header row moves, the data region vanishes, or the column count disagrees with tableColumns.
TABLE_CONTENT_TYPE
attributeTABLE_CONTENT_TYPE= 'application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml'append_table_row
funcappend_table_row(ws, table_name, values)Atomically append one row to a supported named worksheet table.
The operation plans values, calculated columns, styles, totals movement, protection, table geometry, and retained OOXML before changing the model. Unsupported connected, extended, merged, spill, sorted, or ambiguous table states raise a typed refusal and leave the workbook unchanged.
paramwsopenpyxl.worksheet.worksheet.WorksheetWorksheet containing the table.
paramtable_namestrName of the table to expand.
paramvaluesiterable | mappingRow values as a sequence or column-name mapping.
Returns
NoneNone.
plan_table_lifecycle
funcplan_table_lifecycle(wb, ws, sheet_part, zin, armed_names, plan, part_plan, names)Plan table ADD/REMOVE for one sheet: parts via the engine, the
sheet's tableParts element rebuilt as crafted bytes (returned; the
caller rides them through the region splice). armed_names is the
arm-time tuple of table names.
paramwbparamwsparamsheet_partparamzinparamarmed_namesparamplanparampart_planparamnamesplan_table_mutations
funcplan_table_mutations(wb, ws, sheet_part, zin, changed_names, plan, armed_tables=None)Patch each changed loaded table into its ORIGINAL part.
paramwbparamwsparamsheet_partparamzinparamchanged_namesparamplanparamarmed_tables= Nonesheet_table_parts
funcsheet_table_parts(zin, sheet_part){displayName: (part_name, original_bytes)} for one sheet, resolved
through the ORIGINAL rels (producers number table parts arbitrarily —
Table.path's id-derived guess is not trustworthy).
paramzinparamsheet_partvalidate_table
funcvalidate_table(tbl, original_ref)Geometry guards, against the ORIGINAL ref.
paramtblparamoriginal_ref