Metadata-Version: 2.4
Name: offidized
Version: 0.1.2
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Office/Business
Classifier: Topic :: Software Development :: Libraries
Requires-Dist: pydantic-ai>=1.59,<2 ; python_full_version >= '3.10' and extra == 'pydantic-ai'
Provides-Extra: pydantic-ai
Summary: Rust-native OOXML library for xlsx, docx, and pptx with full roundtrip fidelity
License: MIT OR Apache-2.0
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM

# offidized

**Office, oxidized.** Rust-native OOXML library for reading, writing, and manipulating Excel (.xlsx), Word (.docx), and PowerPoint (.pptx) files with full roundtrip fidelity.

## Install

```bash
pip install offidized
```

Supports Python 3.9+ on Linux, macOS, and Windows.

### Optional: PydanticAI Toolsets

Install the optional PydanticAI integration with:

```bash
pip install "offidized[pydantic-ai]"
```

The current `pydantic-ai` release line requires Python 3.10+.

This adds the `offidized.pydantic_ai` helpers for format-first agent toolsets:

- `xlsx_toolset()`
- `docx_toolset()`
- `pptx_toolset()`
- `compose_toolsets()`
- `all_toolsets()`

Each format toolset is designed to include both native document operations and
format-scoped IR-backed editing helpers, so users can compose by document type
instead of managing a separate IR surface.

Minimal example:

```python
from pydantic_ai import Agent

from offidized.pydantic_ai import (
    all_toolsets,
    compose_toolsets,
    docx_toolset,
    xlsx_toolset,
)

agent = Agent(
    "openai:gpt-5",
    toolsets=[
        xlsx_toolset(),
        docx_toolset(),
    ],
)

agent_with_everything = Agent(
    "openai:gpt-5",
    toolsets=[all_toolsets()],
)

agent_with_explicit_composition = Agent(
    "openai:gpt-5",
    toolsets=[compose_toolsets(xlsx_toolset(), docx_toolset())],
)
```

See `examples/offidized_pydantic_ai_toolsets.py` for a small runnable example.

## Python Binding Coverage

The Rust crates have 90%+ feature parity (see root README for details). Below tracks what's exposed to Python.

### Excel (.xlsx)

- [x] Workbook open/save/bytes roundtrip
- [x] Sheet CRUD (add, remove, list)
- [x] Cell read/write (string, number, bool, date)
- [x] Cell formulas
- [x] Cell styles (font, fill, border, alignment, number format)
- [x] Merged ranges
- [x] Freeze panes
- [x] Auto-filter
- [x] Hyperlinks
- [x] Defined names
- [x] Find cells
- [x] Sheet protection (basic + detailed)
- [x] Workbook protection
- [x] Tab color
- [x] Row height / column width
- [x] Images
- [x] Charts
- [x] Conditional formatting
- [x] Data validation
- [x] Cell comments
- [x] Page setup / print settings
- [x] Sheet view options (gridlines, zoom)
- [x] Sparklines
- [x] Pivot tables
- [x] Named/structured tables (full)
- [x] Workbook lint
- [x] Sheet visibility (hidden/very hidden)
- [x] Rich text cells

### Word (.docx)

See:
- `examples/docx/08_redline_review.py` for a minimal tracked-changes/redline workflow
- `examples/docx/09_proposal_review_safe.py` for a layout-safer proposal review workflow based on comments + highlights via `Document.apply_reviews(...)`

- [x] Document open/save/bytes roundtrip
- [x] Paragraphs CRUD
- [x] Headings
- [x] Bulleted / numbered paragraphs
- [x] Paragraph styling (alignment, spacing, indentation)
- [x] Runs with formatting (bold, italic, underline, strikethrough, color, font)
- [x] Hyperlinks on runs
- [x] Tables CRUD + cell text read/write
- [x] Inline images (add, count)
- [x] Sections (page size, orientation, margins)
- [x] Document properties
- [x] Comments/review helpers (add, list, count, anchor to paragraphs, character ranges, mixed-format paragraph text with comments/bookmarks/field results, simple/mixed single- or multi-paragraph table-cell text, simple VML/DrawingML text-box text, and document-level search/review/highlight helpers across supported paragraphs and rich table-cell text in the body, headers, footers, footnotes, and endnotes for Word-visible review balloons)
- [~] Basic tracked changes (list revisions across supported paragraphs in the body, headers, footers, footnotes, and endnotes, plus rich table-cell paragraphs in body/header-footer/footnote/endnote parts and simple nested text-box content inside supported paragraph runs, including basic property/format revision inspection and move range markers; accept/reject insert/delete/move revisions plus conservative `*PrChange`/`tblGridChange` property transforms across that supported surface; append insertion/deletion revisions; compare/redline MVP with body alignment + table anchors plus simple text-box compare and simple table-cell/paragraph compare across supported paragraph parts; broader tracked-change coverage still remaining)
- [x] Footnotes (add, list, count)
- [x] Bookmarks (add, list, count)
- [x] Content controls (count)
- [x] Document protection (basic)
- [x] Body items iteration
- [x] Table structural mutation (add/remove rows/columns)
- [x] Table cell merge
- [x] Table borders / widths / layout
- [x] Section headers and footers
- [x] Endnotes
- [x] Style registry (inspect/create named styles)
- [x] Paragraph borders / shading
- [x] Tab stops
- [ ] Floating images
- [ ] Field codes (TOC, date, etc.)

### PowerPoint (.pptx)

- [x] Presentation open/save/from_bytes
- [x] Slide CRUD (add, remove, clone, move)
- [x] Slide dimensions
- [x] Find/replace text (presentation-wide)
- [x] Presentation properties
- [x] Shapes (add, list, solid fill, alt text, preset geometry, word wrap)
- [x] Shape position / size (`set_geometry(x, y, width, height)` in EMUs)
- [x] Shape rotation (`set_rotation(degrees)`)
- [x] Shape outline (`set_outline(color, width_pt, dash_style)`)
- [x] Shape gradient fill (`set_gradient_fill(stops, angle)`)
- [x] Shape paragraphs (add, list, alignment, spacing, indent, bullets)
- [x] TextRun formatting (bold, italic, underline, strikethrough, font, color, size, hyperlinks, spacing)
- [x] Tables (cell text, column width, row height, cell fill/bold/italic)
- [x] Table cell font size (`set_cell_font_size`) and color (`set_cell_font_color`)
- [x] Charts (title, legend, data points)
- [x] Images (name, content type)
- [x] Slide notes
- [x] Slide transitions
- [x] Slide show settings / custom shows
- [x] Presentation to_bytes
- [x] Shape flip (horizontal/vertical)
- [x] Shape pattern fill / picture fill
- [x] Shape effects (shadow, glow, reflection)
- [x] Slide background
- [x] Slide masters / layouts
- [x] Slide placeholders
- [x] Table cell merge / borders / alignment
- [x] Table add/remove rows/columns
- [x] Chart series / axes / type switching
- [x] Image position / size / replace / export
- [ ] Animation / timing
- [x] Theme colors / fonts

### IR (Intermediate Representation)

- [x] `ir_derive` / `ir_derive_from_bytes`
- [x] `ir_apply` / `ir_apply_to_bytes`
- [x] `UnifiedDocument` (derive, from_ir, to_ir, nodes, capabilities, apply_edits, lint_edits, save_as)

## About

Python binding for [offidized](https://github.com/h0rv/offidized), built with [PyO3](https://pyo3.rs) and [maturin](https://www.maturin.rs). The heavy lifting happens in Rust — Python gets a thin, ergonomic wrapper.

## License

MIT OR Apache-2.0

