Create and update Microsoft Word .docx files.
Project description
python-docx-whtsky
python-docx-whtsky is a Python library for creating and updating Microsoft Word (.docx) files.
More information is available in the python-docx documentation
Release History
0.8.10.2 (2019-10-23)
- Add ability to restart list numbering. ( https://github.com/python-openxml/python-docx/pull/210 )
Example
https://github.com/python-openxml/python-docx/issues/25#issuecomment-143231954
from docx import Document
document = Document()
# Add desired numbering styles to your template file.
# Extract abstractNumId from there. In this example, abstractNumId is 10
numId = document.get_new_list("10")
# Add a list
p = document.add_paragraph(style = 'ListParagraph', text = "a")
p.num_id = numId
p.level = 0
p = document.add_paragraph(style = 'ListParagraph', text = "b")
p.num_id = numId
p.level = 1
p = document.add_paragraph(style = 'ListParagraph', text = "c")
p.num_id = numId
p.level = 1
p = document.add_paragraph(style = 'ListParagraph', text = "d")
p.num_id = numId
p.level = 0
p = document.add_paragraph(style = 'ListParagraph', text = "e")
p.num_id = numId
p.level = 1
p = document.add_paragraph(style = 'ListParagraph', text = "f")
p.num_id = numId
p.level = 0
# Restart numbering at the outer level
numId = document.get_new_list("10")
# Add the same list once again. The numbering is restarted
p = document.add_paragraph(style = 'ListParagraph', text = "a")
p.num_id = numId
p.level = 0
p = document.add_paragraph(style = 'ListParagraph', text = "b")
p.num_id = numId
p.level = 1
p = document.add_paragraph(style = 'ListParagraph', text = "c")
p.num_id = numId
p.level = 1
p = document.add_paragraph(style = 'ListParagraph', text = "d")
p.num_id = numId
p.level = 0
p = document.add_paragraph(style = 'ListParagraph', text = "e")
p.num_id = numId
p.level = 1
p = document.add_paragraph(style = 'ListParagraph', text = "f")
p.num_id = numId
p.level = 0
document.save("num.docx")
0.8.10.1 (2019-10-16)
- allow table looking (header row/col, footer row/col, bands) modification. https://github.com/python-openxml/python-docx/pull/579
- Added font property to paragraph. https://github.com/python-openxml/python-docx/pull/417
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for python-docx-whtsky-0.8.10.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 603c7db2fb5a03c754428c20823b3eba1904b80da22b5f754131636b1bdcf240 |
|
MD5 | 6c453d99824e357c514d3b951689360a |
|
BLAKE2b-256 | 3baa7f06a6b82f6e73ad3e6078d255e7693ff86e26ab4ef7b7f51cb06b7cf2a5 |
Close
Hashes for python_docx_whtsky-0.8.10.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 473fcf8007222bace0462080ea3f8f71f3ed379c44e148b268ebbaff262e2aab |
|
MD5 | 8d3b8521ecc0073d908c5649717a304b |
|
BLAKE2b-256 | 9b8b11b2ba0f35a4718fa72c5e5e4593ea94387e0ced99e26fa689d8f0efd8ab |