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.0a26

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.0a26
File Size Uploaded
docxray-0.0.0a26.tar.gz 141.9 kB Details

Built distribution (wheel)

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

Total release size: 321.8 kB

Release files / docxray-0.0.0a26.tar.gz

Download URL docxray-0.0.0a26.tar.gz
Size 141.9 kB
Tags Source
SHA-256 checksum
How to use checksums
11340c7cbd693c59ab21ee768574021d7b9b7e107d72cc80779ce2fcaec2e322
BLAKE2b-256 checksum
How to use checksums
671705fd27c8eb1f6de3967d12c271b387ff0d3e41329168748564f6cb8b5b50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.10

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

Download URL docxray-0.0.0a26-py3-none-any.whl
Size 179.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8f64baf0dbe880319b7fcaed945c184c61c56ab1b4b59560fb141849603056fa
BLAKE2b-256 checksum
How to use checksums
80bf671354b90b468f1a8c3248d27205ef5033c73ed858f26bd41d07f563f590
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