Paper Office
paper-pptxAPI referenceinspect

BlockAnchor

paper-pptx 0.2.0 API reference

A structural current anchor or conservative three-field legacy anchor.

Fields:

  • part -- partname of the story the block lives in (a slide or notes slide).
  • block_index -- diagnostic 0-based part traversal index. Current anchors never use it as write identity.
  • content_hash -- a current full structural fingerprint, or the pinned eight-character text hash on a legacy anchor.
  • version -- current anchor schema version; absent on legacy anchors.
  • locator -- exact container identity and container-local paragraph coordinates.

Existing BlockAnchor(part, block_index, content_hash) construction remains valid and creates a legacy anchor. Legacy writes search the named part for an exact unique hash match.

BlockAnchor(part: str, block_index: int, content_hash: str, version: Optional[int] = None, locator: Optional[dict] = None)

Attributes

block_index

attributeblock_indexint

content_hash

attributecontent_hashstr

is_legacy

attributeis_legacybool

Whether this is an old three-field anchor without structural identity.

locator

attributelocatorOptional[dict]
= None

part

attributepartstr

version

attributeversionOptional[int]
= None

Functions

to_dict

functo_dict() -> dict

Return this anchor as a JSON-ready dict. Store it to re-target the same text block on a later open.

Returns

dict

On this page