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.0.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.0-py3-none-any.whl
(10.3 kB
view details)
File details
Details for the file pymdocx-0.4.0.tar.gz.
File metadata
- Download URL: pymdocx-0.4.0.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 |
642d6f983ff3d5d05bd9018ce6084e119a4725fef378afb205b6d5f1f79ebf5e
|
|
| MD5 |
ecb5721b83581f787273ee4b87e1dd92
|
|
| BLAKE2b-256 |
70ba1d3e6930bba9ac76c3f29fa6423b723253016ca0dd1c67a92a8b9e41bc6d
|
File details
Details for the file pymdocx-0.4.0-py3-none-any.whl.
File metadata
- Download URL: pymdocx-0.4.0-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 |
c4ce49e14389c83259567b0809960be3e745dd2a23fc9a724c7d5a1e0a6d6970
|
|
| MD5 |
2d2c2cf95a486e8fed9b9d2413932603
|
|
| BLAKE2b-256 |
e2a93782998556436ce4e23eb55fd851b26af633205f4c895dc8b847c5871ce4
|