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.1.0.tar.gz
(28.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.1.0.tar.gz.
File metadata
- Download URL: docx2tiptap-0.1.0.tar.gz
- Upload date:
- Size: 28.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 |
badcde90a0e46123f8fe311840fee35a69f0a383de89024321ff24ce73fc7116
|
|
| MD5 |
ea2bfd77dcb63a45113f44d17d29158e
|
|
| BLAKE2b-256 |
6cfd2695753603bd3dabd0d247b9892efaa1b28001b15b6f5c7c001be7737f81
|
File details
Details for the file docx2tiptap-0.1.0-py3-none-any.whl.
File metadata
- Download URL: docx2tiptap-0.1.0-py3-none-any.whl
- Upload date:
- Size: 31.3 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 |
7d0841e5cd82c02ee181a9720726f8083a800e11a27f2f091124e715354b2fb3
|
|
| MD5 |
b28fd9edad92496c97e499126281fcdf
|
|
| BLAKE2b-256 |
bea2f9d2a73111a164cd96b8ab497d76192b7333ae75b556c4a162ea0befd2e3
|