Skip to main content

Reads .docx tracked-changes as drafting trajectory — paste-burst detection, authorship distribution, thrashing patterns

Project description

revision-analyser

Reads a Word document's drafting trajectory — not its final text. The lens-family member that surfaces how a document was written, not what it says.

Parses Word's embedded Track Changes (<w:ins>, <w:del>, <w:moveFrom>, <w:moveTo> elements in document.xml) to produce:

  • timeline of insertions/deletions/moves with author and timestamp
  • paste-burst detection (a single insertion ≥ N words ≈ paste from AI/elsewhere)
  • per-author rollups (single-author vs collaborative editing)
  • thrashing patterns (many small clustered edits)

The single strongest written-work process signal — but only if the student had Track Changes on. A .docx with no revisions is itself a signal: track_changes_enabled: false (often means the final version was pasted in). Explicit-only: .docx continues to auto-route to document-analyser for content; invoke revision-analyser deliberately for the revision history.

Scope: v1 reads Word .docx tracked changes only. Google Docs revision history (Drive API) and draft-sequence comparison are planned for v2.

Install

pip install revision-analyser

Use

Python:

from revision_analyser import RevisionAnalyser

result = RevisionAnalyser().analyse("essay.docx")
print(result.track_changes_enabled)        # True
print(result.total_insertions)             # 47
print(result.paste_burst_count)            # 2
print(result.authors[0].name)              # "Jane Student"
print(result.timeline_minutes)             # 184.5  (≈ 3 hours of editing)

CLI:

revision-analyser essay.docx
revision-analyser essay.docx --json
revision-analyser serve
revision-analyser manifest

HTTP (revision-analyser serve on port 8016):

curl -F file=@essay.docx http://localhost:8016/analyse

Signals

  • track_changes_enabled — whether the doc carries any tracked revisions at all. Absence is itself a signal (final-paste workflow).
  • Totals — insertion count, deletion count, move count.
  • Word-level totalsinsertion_word_count, deletion_word_count.
  • Paste bursts — insertions whose single contiguous text is ≥ 25 words (tuneable). These are the strongest paste-from-elsewhere markers.
  • Authors — list with per-author insertion/deletion totals. One author = self-edits; two = collaborative or feedback cycle.
  • Timelinetimeline_first, timeline_last, timeline_minutes (span of activity).
  • Events — a capped sample of the timeline for inspection.
  • Flags — composite tags: paste_burst_present, single_author, no_revisions_recorded, short_timeline, multiple_authors.

The family

What you want Use
The document's text + readability document-analyser
The document's metadata (editing time, creator app) provenance-analyser
The document's revision history revision-analyser (this)
Reflective depth on text reflection-analyser
Any file → right engine auto-analyser

Triangulation matters here. A polished essay with no recorded revisions + a short total editing time (provenance-analyser) + a descriptive depth band (reflection-analyser) tells a much more focused story than any of the three signals alone.

Limits

  • v1 reads tracked changes only. If the student never enabled Track Changes, the doc reports track_changes_enabled: false — the absence is informative but bears no detail about the actual editing process.
  • Author names are whatever Word recorded (w:author attribute) — often an install-time username, sometimes "Author" if anonymous.
  • Timestamps reflect when the tracked change was made per the authoring machine's clock; trustworthy on a single machine, less so across collaborators.
  • Paste-burst detection is a heuristic — long literary quotes will also score. Surface the burst text in the response so callers can audit.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

revision_analyser-0.2.0.tar.gz (69.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

revision_analyser-0.2.0-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file revision_analyser-0.2.0.tar.gz.

File metadata

  • Download URL: revision_analyser-0.2.0.tar.gz
  • Upload date:
  • Size: 69.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for revision_analyser-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7aec5b8faaa88d3398eb17bba836535b27049e90cfc6130321b484993171aa82
MD5 e4e1772bdfaa9cb629f1afa5872c7c77
BLAKE2b-256 a736f3b70e13496f0978b66f97389c93edac4853f0409ba16d5ab1eb05939fda

See more details on using hashes here.

File details

Details for the file revision_analyser-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for revision_analyser-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 68c87d6bdf377cc5f797c36be153dbba134d380acd91f49f4bc8f3a8e3deaf4b
MD5 2032502327d44925a770663bf84e4137
BLAKE2b-256 96428b58ce757cb7fe8dc1ae153376c1086dfc592c026471c5cf2d998d66d7cf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page