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.9.tar.gz
(8.4 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.9.tar.gz.
File metadata
- Download URL: pymdocx-0.3.9.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
758e3ee1c00a95ca9fd2847102e6a7ba02948ecd36d4fa36c2aa981a7ae83d97
|
|
| MD5 |
7f8447c83ade62d377aac95adc1a8b93
|
|
| BLAKE2b-256 |
f5d4bc22983c7f24897e7a2948d202a27aca8dcea124e8d40d3b3394f0714c8f
|
File details
Details for the file pymdocx-0.3.9-py3-none-any.whl.
File metadata
- Download URL: pymdocx-0.3.9-py3-none-any.whl
- Upload date:
- Size: 9.6 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 |
49e9caf5d425d6f7da63cd6cc1b0628b3ec942b56ff5152df2eb3ed599e8faf1
|
|
| MD5 |
9228bd7f44f0349463233d45d560856a
|
|
| BLAKE2b-256 |
dc162dd75e5ec914d200201dfdfe829510ce2c816c216c8d4a922853a0191fda
|