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.2.tar.gz (41.4 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.2-py3-none-any.whl (46.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: docx2tiptap-0.1.2.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

Hashes for docx2tiptap-0.1.2.tar.gz
Algorithm Hash digest
SHA256 6b41a065533c92b59a9b0c8cd53e15afc27c79e9262e3389410520b54bca58c5
MD5 af45085ddfdd96df81bd1c586819676e
BLAKE2b-256 b13bf789e6ee4a2ab265325fc961411cde9236eeb56632ef09098fc043fa2be2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: docx2tiptap-0.1.2-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

Hashes for docx2tiptap-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7d7bdfafbb0ff94d706d0a8d592a0a950f679ab475924cac5d790fc77d495fef
MD5 df2c5f101183456c32ca9632fcf2f447
BLAKE2b-256 13b0906db366ea4d1b71a0f50d9f61ffca9dcd7e10c1ca7f343bc232ac5440b6

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