Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/python-openxml/python-docx
Create and modify Word documents with Python
https://github.com/python-openxml/python-docx
Last synced: 16 days ago
JSON representation
Create and modify Word documents with Python
- Host: GitHub
- URL: https://github.com/python-openxml/python-docx
- Owner: python-openxml
- License: mit
- Created: 2013-10-15T14:50:41.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2024-08-20T19:00:52.000Z (3 months ago)
- Last Synced: 2024-10-14T12:05:46.794Z (about 1 month ago)
- Language: Python
- Size: 43.1 MB
- Stars: 4,552
- Watchers: 145
- Forks: 1,117
- Open Issues: 651
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.rst
- License: LICENSE
Awesome Lists containing this project
README
# python-docx
*python-docx* is a Python library for reading, creating, and updating Microsoft Word 2007+ (.docx) files.
## Installation
```
pip install python-docx
```## Example
```python
>>> from docx import Document>>> document = Document()
>>> document.add_paragraph("It was a dark and stormy night.")>>> 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](https://python-docx.readthedocs.org/en/latest/)