Paper Office
paper-xlsxAPI referencepreserve.comments

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.

paramzin
paramsheet_part
paramnames
paramaxis
paramindex

comment_machinery_kind

funccomment_machinery_kind(zin, sheet_part, names)

Classify a sheet's comment and VML relationships.

paramzinzipfile.ZipFile

Open workbook package.

paramsheet_partstr

Worksheet 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.

paramwb
paramws
paramsheet_part
paramzin
parampart_plan
paramnames

sheet_has_comment_machinery

funcsheet_has_comment_machinery(zin, sheet_part, names)

True only for comment relationships or VML note shapes.

paramzin
paramsheet_part
paramnames

On this page