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

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.0a32
File Size Uploaded Provenance Actions
docxray-0.0.0a32.tar.gz 142.9 kB Without provenance Details for docxray-0.0.0a32.tar.gz

Built distribution (wheel)

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

Total release size: 323.4 kB

Release files / docxray-0.0.0a32.tar.gz

Download URL docxray-0.0.0a32.tar.gz
Size 142.9 kB
Tags Source
SHA-256 checksum
How to use checksums
78d0a08a8a84f67e9bb83871ba4d758d721d5c71f9eaefa03016baf5ae1e4d07
BLAKE2b-256 checksum
How to use checksums
5402f9c1e85c1d8b0b017bcfd8d45e6af4b838cb4b1b2ce6d9cf1b674f35c55a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.10

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

Download URL docxray-0.0.0a32-py3-none-any.whl
Size 180.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ef3ce21c76d1e721e554e9d15411aa03597a6e450525f29521d9307aad7f543
BLAKE2b-256 checksum
How to use checksums
0a48245d811a04090a46ba21dc372edde0c2b1d7e86b7bb5891b3d7f96dfff50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.10

Security for docxray 0.0.0a32

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
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