openpyxl.preserve.comments
paper-xlsx 0.2.1 API reference
Comments on sheets whose original package carries NO comment machinery — the 80% case. The comments part and its legacy-VML anchor part are created whole via the lifecycle engine (nothing to splice: both parts are new), and one <legacyDrawing r:id> element rides the region splice.
Sheets that ALREADY carry comment parts keep refusing: editing preserved VML is out of scope.
COMMENTS_CONTENT_TYPE
attributeCOMMENTS_CONTENT_TYPE= 'application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml'VML_CONTENT_TYPE
attributeVML_CONTENT_TYPE= 'application/vnd.openxmlformats-officedocument.vmlDrawing'comment_anchors_precede_shift
funccomment_anchors_precede_shift(zin, sheet_part, names, axis, index)Whether every source note anchor is wholly before one shift.
paramzinparamsheet_partparamnamesparamaxisparamindexcomment_machinery_kind
funccomment_machinery_kind(zin, sheet_part, names)Classify a sheet's comment and VML relationships.
paramzinzipfile.ZipFileOpen workbook package.
paramsheet_partstrWorksheet part name in the package.
paramnamesbuiltins.set[str]Part names present in the package.
Returns
str | None"comments", "other-vml", or None.
plan_comment_creation
funcplan_comment_creation(wb, ws, sheet_part, zin, part_plan, names)Create the comments + VML parts for one comment-free sheet; returns the crafted <legacyDrawing r:id> bytes for the region splice.
paramwbparamwsparamsheet_partparamzinparampart_planparamnamessheet_has_comment_machinery
funcsheet_has_comment_machinery(zin, sheet_part, names)True only for comment relationships or VML note shapes.
paramzinparamsheet_partparamnames