pydocx is a Python library for merging revised and commented Microsoft Word files.
Project description
pydocx is a Python library for merging revised and commented Microsoft Word files.
Installation
pip install pymdocx
Usage
import os
from pymdocx.common.utils import get_doc
from pymdocx.doc.paragraph import merge_paragraph_comment_revision
from pymdocx.doc.table import merge_table_comment_revision
DIR_PATH = './../data/test_table'
# merge_docx
doc_o_path = os.path.join(DIR_PATH, 'table.docx')
doc_a_path = os.path.join(DIR_PATH, 'table_a.docx')
doc_b_path = os.path.join(DIR_PATH, 'table_b.docx')
doc_o = get_doc(doc_o_path)
doc_a = get_doc(doc_a_path)
doc_b = get_doc(doc_b_path)
merge_paragraph_comment_revision(doc_o, [doc_a, doc_b])
merge_table_comment_revision(doc_o, [doc_a, doc_b])
doc_o.save('table_new.docx')
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
pymdocx-0.4.1.tar.gz
(9.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
pymdocx-0.4.1-py3-none-any.whl
(10.3 kB
view details)
File details
Details for the file pymdocx-0.4.1.tar.gz.
File metadata
- Download URL: pymdocx-0.4.1.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b7a4481d1fc6fceaab97e7fa6cc15def716807dae8533af09f1deb2de00d5e5
|
|
| MD5 |
f9a605949664930b993a40b2772fb5ef
|
|
| BLAKE2b-256 |
798eb223321c461e5a180ce25af9cbdacc53c79ea141823b7ba1953f5ed2161a
|
File details
Details for the file pymdocx-0.4.1-py3-none-any.whl.
File metadata
- Download URL: pymdocx-0.4.1-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
371f2563e6a2f66bf8e2620efddc5003903e82700b789d1782005f1cca039a19
|
|
| MD5 |
84cdefda3f3549d3e679d536ecc3053d
|
|
| BLAKE2b-256 |
64cc525fc95cfd8ea3e7b68899415a8a6a9ccdb4e2ca73f3c36c6cfcf61a94cf
|