Create, read, and update Microsoft Word .docx files.
Project Links
Meta
Author: Steve Canny
Requires Python: >=3.9
Classifiers
Development Status
- 5 - Production/Stable
Environment
- Console
Intended Audience
- Developers
License
- OSI Approved :: MIT License
Operating System
- OS Independent
Programming Language
- Python
- Python :: 3
- Python :: 3.7
- Python :: 3.8
- Python :: 3.9
- Python :: 3.10
- Python :: 3.11
Topic
- Office/Business :: Office Suites
- Software Development :: Libraries
python-docx
python-docx is a Python library for reading, creating, and updating Microsoft Word 2007+ (.docx) files.
Installation
pip install python-docx
Example
>>> from docx import Document
>>> document = Document()
>>> document.add_paragraph("It was a dark and stormy night.")
<docx.text.paragraph.Paragraph object at 0x10f19e760>
>>> document.save("dark-and-stormy.docx")
>>> document = Document("dark-and-stormy.docx")
>>> document.paragraphs[0].text
'It was a dark and stormy night.'
More information is available in the python-docx documentation
1.2.0
Jun 16, 2025
1.1.2
May 01, 2024
1.1.1
Apr 30, 2024
1.1.0
Nov 04, 2023
1.0.1
Oct 12, 2023
1.0.0
Oct 10, 2023
1.0.0rc1
Oct 02, 2023
0.8.11
May 15, 2021
0.8.10
Jan 09, 2019
0.8.9
Jan 08, 2019
0.8.8
Jan 08, 2019
0.8.7
Aug 19, 2018
0.8.6
Jun 22, 2016
0.8.5
Feb 22, 2015
0.8.4
Feb 21, 2015
0.8.3
Feb 20, 2015
0.8.2
Feb 16, 2015
0.8.1
Feb 11, 2015
0.8.0
Feb 09, 2015
0.7.6
Dec 14, 2014
0.7.5
Nov 29, 2014
0.7.4
Jul 18, 2014
0.7.3
Jul 14, 2014
0.7.2
Jul 13, 2014
0.7.1
Jul 12, 2014
0.7.0
Jun 27, 2014
0.6.0
Jun 22, 2014
0.5.3
May 10, 2014
0.5.2
May 07, 2014
0.5.1
Apr 03, 2014
0.5.0
Mar 02, 2014
0.4.0
Mar 01, 2014
0.3.0a5
Jan 10, 2014
0.3.0a4
Jan 07, 2014
0.3.0a3
Jan 06, 2014
0.3.0a2
Jan 06, 2014
0.3.0a1
Jan 05, 2014