pydocx is a Python library for updating Microsoft Word files.
Project description
pydocx is a Python library for updating 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.3.7.tar.gz
(7.6 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
File details
Details for the file pymdocx-0.3.7.tar.gz.
File metadata
- Download URL: pymdocx-0.3.7.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1eaf181a0cabfe52d38e4ca9c91665331becc2b6c97a303a60ffa56a95a06a9
|
|
| MD5 |
9e5fb8634956414faca51bf7d4f1d9b1
|
|
| BLAKE2b-256 |
456a38e675ff4c5188fae250f069e6e5fab9f89225af35a6fa45a77b95bb82ce
|
File details
Details for the file pymdocx-0.3.7-py3-none-any.whl.
File metadata
- Download URL: pymdocx-0.3.7-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30cf6a7bccdacba9c7dfe3f80f3a0190b7182d7c50b938caba968e8254c7a46a
|
|
| MD5 |
8265b140e55826da39b690bfc889105e
|
|
| BLAKE2b-256 |
11ced554f93420fcf3417cf4d344d134f0cc3e66da27b4af3ee957abc9ea60c1
|