Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Docxray

A sophisticated DOCX analysis library — fork of python-docx with advanced parsing, styling intelligence, and deep ECMA-376 compliance.

Built for reading, inspecting, and transforming .docx (OOXML Transitional) documents with precision.


✨ Key Features

  • 🧠 Smart property resolution – inherits formatting from style hierarchies, following ECMA-376 rules (not just raw XML values)
  • 🖼️ Rich image support – works with Pillow or Wand (ImageMagick); handles modern formats plus legacy WMF/EMF
  • 🔄 HTML transformation – proxy objects (Paragraph, Table, etc.) include methods to convert content to HTML with rendering options
  • ✅ XSD soft validation – validates simple types against the official schema
  • 🔢 Intelligent list handling – numeral module correctly restores list-item text for most common cases

🚀 Quick Start

from docxray import Document

doc = Document("path/to/your/document.docx")

# Iterate through all inner content
for item in doc.iter_inner_content():
    # Process paragraphs, tables, runs, etc.
    pass

📦 Installation

pip install docxray

Additional Dependencies

ImageMagick is required for full image processing support when using the Wand library. Without ImageMagick, Docxray will fall back to using Pillow for image handling.

  • For Wand (recommended for advanced formats like WMF/EMF):
    • macOS: brew install imagemagick
    • Ubuntu/Debian: sudo apt-get install imagemagick libmagickwand-dev
    • Windows: Download and install from ImageMagick official site (ensure the development headers are included)

Note: If both Wand and ImageMagick are available, Docxray will use them for superior format support. If ImageMagick is missing, the library automatically falls back to Pillow for basic image operations.


📖 Documentation

Docxray is designed for read‑only document analysis. It provides:

  • Full access to document structure (paragraphs, runs, tables, images)
  • Styling attributes resolved through the complete OOXML style inheritance chain
  • Convenient proxies for manipulating content before export (e.g., to HTML)
  • Validation utilities to check document conformance

🧪 Example: Inspecting Run Properties

for item in doc.iter_inner_content():
    if isinstance(item, Paragraph):
        for p_item in item.iter_inner_content():
            if isinstance(p_item, Run) and p_item.italic:
                print(f"Italic text: {p_item.raw_text}")

📄 License

MIT — free for personal and commercial use.


🙏 Acknowledgements

Built as a fork of the excellent python-docx project, extended for deeper ECMA-376 compliance and analysis capabilities.

Metadata

Release files for docxray 0.0.0a28

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for docxray 0.0.0a28
File Size Uploaded
docxray-0.0.0a28.tar.gz 142.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for docxray 0.0.0a28
File Interpreter ABI Platform
docxray-0.0.0a28-py3-none-any.whl Python 3 none any Details

Total release size: 322.4 kB

Release files / docxray-0.0.0a28.tar.gz

Download URL docxray-0.0.0a28.tar.gz
Size 142.3 kB
Tags Source
SHA-256 checksum
How to use checksums
cdf33f81a6e8fe9ed2f779fb2bd1b707bee80d66280993a9f7af3a9850e18791
BLAKE2b-256 checksum
How to use checksums
73f5316c1809c181e1809b2165b796eeecd41353460be2dfca0211062e32252a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.10

Release files / docxray-0.0.0a28-py3-none-any.whl

Download URL docxray-0.0.0a28-py3-none-any.whl
Size 180.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f72195274c25aea5ef1e1f81e9c3d880ed39289262457d0b9437eb8349e788e5
BLAKE2b-256 checksum
How to use checksums
267016eef1810a2acd294cda17c227f868d186c6005c3224f1014d83cacc67c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.10
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page