Create and update Microsoft Word .docx files.
python-docx is a Python library for creating and updating Microsoft Word (.docx) files.
More information is available in the python-docx documentation.
- Add Table.autofit
- Add feature #46: _Cell.width
- Fix: Word does not interpret <w:cr/> as line feed
- Add feature #14: Run.add_picture()
- Add feature #68: Paragraph.insert_paragraph_before()
- Add feature #51: Paragraph.alignment (read/write)
- Add feature #61: Paragraph.text setter
- Add feature #58: Run.add_tab()
- Add feature #70: Run.clear()
- Add feature #60: Run.text setter
- Add feature #39: Run.text and Paragraph.text interpret ‘n’ and ‘t’ chars
- Add feature #15: section page size
- Add feature #66: add section
- Add page margins and page orientation properties on Section
- Major refactoring of oxml layer
- Add feature #19: Run.underline property
- Add feature #17: character style
- Fix issue #23, Document.add_picture() raises ValueError when document contains VML drawing.
- Add 20 tri-state properties on Run, including all-caps, double-strike, hidden, shadow, small-caps, and 15 others.
- Advance from alpha to beta status.
- Add pure-python image header parsing; drop Pillow dependency
- Hotfix: issue #4, Document.add_picture() fails on second and subsequent images.
- Complete Python 3 support, tested on Python 3.3
- Fix setup.py error on some Windows installs
- Full object-oriented rewrite
- Feature-parity with prior version
- text: add paragraph, run, text, bold, italic
- table: add table, add row, add column
- styles: specify style for paragraph, table
- picture: add inline picture, auto-scaling
- breaks: add page break
- tests: full pytest and behave-based 2-layer test suite
- Round-trip .docx file, preserving all parts and relationships
- Load default “template” .docx on open with no filename
- Open from stream and save to stream (file-like object)
- Add paragraph at and of document
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.