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

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

Built distribution (wheel)

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

Total release size: 322.1 kB

Release files / docxray-0.0.0a25.tar.gz

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

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

Download URL docxray-0.0.0a25-py3-none-any.whl
Size 180.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e5e281ddb2b7a93edea47413d9d82fc2087ecb26e65eb9f413b1ece052f963f
BLAKE2b-256 checksum
How to use checksums
2427f59fe8c22b561ae5feb02b0103482fac29ad4325922346c248d95adc4547
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