
python-docx — python-docx 1.2.0 documentation
python-docx ¶ Release v1.2.0 (Installation) python-docx is a Python library for creating and updating Microsoft Word (.docx) files.
Quickstart — python-docx 1.2.0 documentation
This opens up a blank document based on the default “template”, pretty much what you get when you start a new document in Word using the built-in defaults. You can open and work on an existing …
Working with Documents — python-docx 1.2.0 documentation
You can open any Word 2007 or later file this way (.doc files from Word 2003 and earlier won’t work). While you might not be able to manipulate all the contents yet, whatever is already in there will load …
Working with Text — python-docx 1.2.0 documentation
An example would be a word that appears in bold or a sentence in all-caps. The most common inline object is a run. All content within a block container is inside of an inline object. Typically, a paragraph …
Text-related objects — python-docx 1.2.0 documentation
This case is unlikely to occur in practice because Word places even-paragraph-boundary page-breaks on the paragraph following the page-break. Still, it is possible and must be checked for.
Document objects — python-docx 1.2.0 documentation
Word works out which text to highlight in the UI based on these range markers. text allows the contents of a simple comment to be provided in the call, providing for the common case where a comment is a …
Font — python-docx 1.2.0 documentation
Word allows multiple typefaces to be specified for character content in a single run. This allows different Unicode character ranges such as ASCII and Arabic to be used in a single run, each being rendered …
Font Color — python-docx 1.2.0 documentation - Read the Docs
According to the spec, the RGB color value is ignored when a theme color is specified, but Word writes the current RGB value of the theme color along with the theme color name (e.g. ‘accent1’) when …
Table objects — python-docx 1.2.0 documentation
Note that Word allows table rows to start later than the first column and end before the last column. Only cells actually present are included in the return value.
Paragraph formatting — python-docx 1.2.0 documentation
In Word, each paragraph has an alignment attribute that specifies how to justify the lines of the paragraph when the paragraph is laid out on the page. Common values are left, right, centered, and …