Skip to content

Metadata & Scrubbing

Setting Metadata

doc.set_metadata(
    author="Jane Smith",
    title="Research Paper",
    subject="Computer Science",
)

Metadata Scrubbing

Scrubbing replaces all identifying metadata (edit times, revision counts, last modified by, etc.) with clean, realistic values:

doc.set_metadata(author="Jane Smith", scrub=True)

This is useful for:

  • Academic submissions — Remove edit history before submission
  • Professional documents — Clean metadata before sharing externally
  • Privacy — Remove computer name, username, and editing timestamps

What Gets Scrubbed

Field Before After
Author DESKTOP-ABC123\admin Jane Smith
Last Modified By admin Jane Smith
Created 2026-06-10 03:42:17 Realistic date
Modified 2026-06-15 21:11:30 Realistic date
Revision 47 2 or 3
Total Edit Time PT847M Realistic duration
Application Microsoft Office Word Microsoft Office Word

Reading Metadata

meta = doc.metadata
print(meta.author)
print(meta.title)
print(meta.to_dict())

CLI Scrubbing

papersmith scrub document.docx --author "Public Author"

# Save to a different file
papersmith scrub document.docx --author "Public Author" --output clean.docx