Parse DOCX files and convert to TipTap JSON format
Project description
docx2tiptap
Parse DOCX files and convert to TipTap/ProseMirror JSON format.
Installation
pip install docx2tiptap
Usage
from docx2tiptap import parse_docx, to_tiptap, create_docx_from_tiptap
# Parse DOCX to TipTap JSON
with open("document.docx", "rb") as f:
elements, comments = parse_docx(f.read())
tiptap_doc = to_tiptap(elements, comments)
# Export TipTap JSON back to DOCX
docx_buffer = create_docx_from_tiptap(tiptap_doc)
with open("output.docx", "wb") as f:
f.write(docx_buffer.read())
Features
- Parse DOCX paragraphs, headings, and tables
- Handle merged cells (colspan/rowspan)
- Preserve track changes (insertions/deletions)
- Extract and export comments
- Convert to/from TipTap JSON format
License
AGPL-3.0-or-later
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
docx2tiptap-0.2.0.tar.gz
(41.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 docx2tiptap-0.2.0.tar.gz.
File metadata
- Download URL: docx2tiptap-0.2.0.tar.gz
- Upload date:
- Size: 41.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
734cb28cb7a75b7b11acc98cc615e18f8c146965af95cce0293630fa69518df3
|
|
| MD5 |
6c410670496157d578b395edbef9b7d4
|
|
| BLAKE2b-256 |
cbe02938128cb7f7854a54fbf6509a1cf06e09eaeb972e221b2a88a67aaa87f0
|
File details
Details for the file docx2tiptap-0.2.0-py3-none-any.whl.
File metadata
- Download URL: docx2tiptap-0.2.0-py3-none-any.whl
- Upload date:
- Size: 46.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f68371818e7debecdb0015103c1c54aaba43c5a14536f26ca1c19b8bbeb6c4c
|
|
| MD5 |
fda8d7ac4c7836d5c8eb6bcac640c140
|
|
| BLAKE2b-256 |
0fec9cf115ceb8c1cfd606e18b3b4e629616a3b6aea1b4f88c25fa8624662ae5
|