Skip to main content

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.1.tar.gz (34.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

docx2tiptap-0.1.1-py3-none-any.whl (37.5 kB view details)

Uploaded Python 3

File details

Details for the file docx2tiptap-0.1.1.tar.gz.

File metadata

  • Download URL: docx2tiptap-0.1.1.tar.gz
  • Upload date:
  • Size: 34.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for docx2tiptap-0.1.1.tar.gz
Algorithm Hash digest
SHA256 fa809b20d3447c97742d4985d8be028f7faeb1748d1f8f5d742ff3363b3097eb
MD5 1b1d03509a0909397fa69b383661e0db
BLAKE2b-256 bc8b4278412f8a7ba25d1c28a4eda3549a5b056b6f34a267294ead3e9ebee6bf

See more details on using hashes here.

File details

Details for the file docx2tiptap-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: docx2tiptap-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 37.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for docx2tiptap-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0ab4c606edaac16f049cfefb6e4ea436750c3b5b0ee6cdd581686bac9d106657
MD5 442463fdf59f6033a6aede8530f6f108
BLAKE2b-256 fd71dee836ae34b5256b37d3b3f64e4e32a56fa7e1785531368f6afb151e79bd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page