ReadOnly python-docx fork lib
Project description
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 element in doc.iter_inner_content():
# Process paragraphs, tables, runs, etc.
pass
📦 Installation
pip install docxray
Optional dependencies:
Pillow– for standard image formatsWand– for extended formats (including WMF/EMF)
📖 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 paragraph in doc.paragraphs:
for run in paragraph.runs:
# Resolves inherited italic/bold/etc. from styles
if run.italic:
print(f"Italic text: {run.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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file docxray-0.0.0a15.tar.gz.
File metadata
- Download URL: docxray-0.0.0a15.tar.gz
- Upload date:
- Size: 125.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2488d4c2bfb3f68d9bce90a7e5cb1fb59f6b76865f6d3669e32ed669294876c4
|
|
| MD5 |
ba9ae035634826318c5c72317396eb13
|
|
| BLAKE2b-256 |
22c956c06a5269c31c36dc4150315a15c759172699e7fae79e881cb2c1c1379b
|
File details
Details for the file docxray-0.0.0a15-py3-none-any.whl.
File metadata
- Download URL: docxray-0.0.0a15-py3-none-any.whl
- Upload date:
- Size: 163.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1caf56209bb31590ff65c0d96f16a3dacfdf8544f82af909b6f7930b4006308
|
|
| MD5 |
02e364db920b962b5fe0ad92010853fc
|
|
| BLAKE2b-256 |
b26dbed989f59fcdcf7247e573e691efb1f6ae57db939d9d45317b97520f5fa9
|