Docx file template replacing
Project description
Intended Purpose
To facilitate the substitution of reserved tags within a docx template.
This utility supports the replacement of paragraph strings, cell strings, text box strings, headers, and footers.
Furthermore, it enables the insertion of tables and images.
Requirements
pip install python-docx
pip install pandas
python3
Basic Usage
from WordWriter import WordWriter
resultsDict = {}
resultsDict["#[testheader1]#"] = "test header 1"
resultsDict["#[testheader2]#"] = "test header 2"
resultsDict["#[testString]#"] = "test strings"
resultsDict["#[testfooter]#"] = "test footer"
resultsDict["#[TX-testString2]#"] = "text box strings"
resultsDict["#[testTableString1]#"] = "cell text 1"
resultsDict["#[testTableString2]#"] = "cell text 2"
resultsDict["#[IMAGE-test1-(30,30)]#"] = "testPicture.png"
resultsDict["#[IMAGE-test2]#"] = "testPicture2.png"
resultsDict["#[IMAGE-test3-(10,10)]#"] = "testPicture.png"
resultsDict["#[TABLE-test1]#"] = "testTable.txt"
WordWriter("test.docx", "output.docx", resultsDict)
Document
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
WordWriter-3.0.1.tar.gz
(7.0 kB
view hashes)
Built Distributions
WordWriter-3.0.1-py3-none-any.whl
(11.5 kB
view hashes)
Close
Hashes for WordWriter-3.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03f506104ca0d97ad5b1d7724c067e222e1e942136139a50d01fff27a5ddb9cb |
|
MD5 | dd869b7c2fb2968a9ace769ab76a3345 |
|
BLAKE2b-256 | 3162579ced6437325b26091e650ba62cdf254e3f2488ca6d14946f2de98642ed |
Close
Hashes for WordWriter-3.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d02776a96f9ddb76c54002681e2ba62b11bf82009d3563919e443752110c49b2 |
|
MD5 | e2ebb8855d340da1cfe2272e017603ae |
|
BLAKE2b-256 | 79d7729a8e1e8c040b5525b2c8464170bd1123fb21eda96449c7f471ccc726da |