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.1.tar.gz
(41.8 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.1.tar.gz.
File metadata
- Download URL: docx2tiptap-0.2.1.tar.gz
- Upload date:
- Size: 41.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8a1629072c1f8d68a540e1e648c717152f4ccb61950007047fdefe55a00afcb
|
|
| MD5 |
58b84b498730f194f25310559a791def
|
|
| BLAKE2b-256 |
36fc22ae5b459a0157a177cf5bd244e0f264d67fd89aa7b950e45d8f85808730
|
File details
Details for the file docx2tiptap-0.2.1-py3-none-any.whl.
File metadata
- Download URL: docx2tiptap-0.2.1-py3-none-any.whl
- Upload date:
- Size: 46.9 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 |
a7134c68b8721656a3008b577e2865d1ad0e07e20d6b93d1aee5f849af8ff817
|
|
| MD5 |
29764acd2c762a82e27688133a14768c
|
|
| BLAKE2b-256 |
b0748f0bc007239a58423ef7de459072d4ca7045d32b1fe97e510d292a9cf45f
|