| What it is | Create and modify Word documents with Python | Create, edit, render and convert Word documents to multiple formats without using external software | Native DOCX creation, editing, comparison, layout, and rendering | Extract docx headers, footers, text, footnotes, endnotes, properties, comments and images |
| Features | - open existing .docx files or create new ones, and save them
- paragraphs, runs and character formatting (bold, italic, font, size, colour)
- tables: add, read and modify rows, columns and cells
- sections and page setup: orientation, size and margins
- headers and footers
- styles: apply and define paragraph, character and table styles
- inline pictures sized in inches, centimetres or points
- comments (added in 1.2.0)
- All 11 features
| - load DOC, DOT, DOCX, DOCM, RTF, WordML, HTML, MHTML, ODT, TXT, Markdown, PDF, EPUB, MOBI, AZW3 and CHM
- save to DOCX, DOC, RTF, ODT, HTML, Markdown, PDF, XPS, EPUB, SVG, PostScript, PCL, XLSX and TIFF, PNG, JPEG, BMP, GIF, WebP and EMF images
- Word to PDF conversion without Microsoft Word installed
- document object model for creating and editing documents
- mail merge from databases and other data sources
- report generation from templates (Aspose.Words Report)
- password protection and encryption
- APIs for .NET, Java, C++, Python via .NET and Node.js via .NET; also Android via Java
- All 11 features
| - create, open, edit, validate and save .docx, .docm, .dotx and .dotm packages
- keeps unmodelled XML byte for byte when saving
- native Word layout with bundled metric-compatible fonts for deterministic output
- PDF, PDF/A, PNG, JPEG, TIFF and SVG output
- HTML, Markdown, MHTML, RTF, ODT and EPUB output
- tracked changes rendered with --revision-view tracked, optionally in a legal colour style
- document comparison at run, word or character granularity into a tracked-changes .docx
- list, accept and reject tracked revisions by id, author or date range
- All 13 features
| - body, headers, footers, footnotes and endnotes as nested lists with paragraphs at depth 4
- tables always returned as n×m lists; merged cells duplicated or left empty
- Par objects with each paragraph's style, list position, runs and XML element
- checkbox and dropdown selections
- comments as (reference text, author, date, comment text)
- document properties such as creator and lastModifiedBy
- images, as bytes or saved to a folder, with placeholders in the text
- math equations
- All 13 features
|
| Limitations | - Doesn't open the old binary .doc format from Word 2003 and earlier: it reads and writes Word 2007+ .docx files only
- Doesn't add floating pictures that text wraps around: python-docx only supports inline pictures
| - Doesn't work with spreadsheet data: it can save to XLSX but doesn't interpret spreadsheets
| - Doesn't open binary Word .doc or Word 2003 XML files: the README calls them permanent non-goals
- Doesn't export the tracked-changes view to HTML or Markdown: those conversions refuse --revision-view tracked
- Doesn't run macros, ActiveX, OLE objects or add-ins: it keeps them in the file without executing them
| - Doesn't create Word documents: it extracts content from existing .docx files, and edits only lightly through their XML (search and replace)
|