# yfedoseev/office_oxide architecture

> Architecture diagram of the GitHub repository yfedoseev/office_oxide, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yfedoseev/office_oxide
- Repository: https://github.com/yfedoseev/office_oxide

## Overview

Office Oxide is a Rust-core library for extracting and converting text from six Office formats, exposed through language bindings, a CLI, and an MCP server. The main workflow is to open a document, identify its format, parse format-specific content into a shared representation, then return text, Markdown, or IR. The graph also includes legacy and OOXML parsing, shared package handling, resource/read options, and editing. README claims support for all listed bindings and interfaces; several binding and service internals were not sampled, so those connections rely on README statements rather than inspected implementations.

Main entry points: [`src/format.rs`](https://github.com/yfedoseev/office_oxide/blob/main/src/format.rs) (Format identification), [`src/lib.rs`](https://github.com/yfedoseev/office_oxide/blob/main/src/lib.rs) (Rust document API), [`src/convert_docx.rs`](https://github.com/yfedoseev/office_oxide/blob/main/src/convert_docx.rs) (DOCX reader), [`src/core/opc.rs`](https://github.com/yfedoseev/office_oxide/blob/main/src/core/opc.rs) (OOXML package reader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_rust_api["Rust document API<br/>[lib.rs]"]
  node_cli["Command-line interface<br/>[main.rs]"]
  node_mcp["MCP server<br/>[main.rs]"]
end

subgraph group_parsing["Format parsing"]
  node_format_detect["Format identification<br/>[format.rs]"]
  node_docx_reader["DOCX reader<br/>[convert_docx.rs]"]
  node_xlsx_reader["XLSX reader<br/>[convert_xlsx.rs]"]
  node_pptx_reader["PPTX reader<br/>[convert_pptx.rs]"]
  node_doc_reader["Legacy DOC reader<br/>[convert_doc.rs]"]
  node_xls_reader["Legacy XLS reader<br/>[convert_xls.rs]"]
  node_ppt_reader["Legacy PPT reader<br/>[convert_ppt.rs]"]
  node_cfb["OLE container reader<br/>[reader.rs]"]
end

subgraph group_shared["Shared processing"]
  node_opc["OOXML package reader<br/>[opc.rs]"]
  node_xml_rels["XML and relationships<br/>[xml.rs]"]
  node_limits["Resource limits<br/>[limits.rs]"]
  node_read_options["Read preferences<br/>[read_options.rs]"]
end

subgraph group_results["Results and editing"]
  node_ir["Document IR<br/>[ir.rs]"]
  node_render["Text and Markdown<br/>[ir_render.rs]"]
  node_editing["Document editing<br/>[edit.rs]"]
end

subgraph group_bindings["Language bindings"]
  node_python["Python binding"]
  node_go["Go binding<br/>[office_oxide.go]"]
  node_csharp["C&#35; binding<br/>[Document.cs]"]
  node_node["Node binding<br/>[index.js]"]
  node_c_ffi["C FFI<br/>[ffi.rs]"]
  node_wasm["WASM binding<br/>[wasm.rs]"]
end

node_caller(("Document consumer"))

node_caller -->|"opens document"| node_rust_api
node_caller -->|"runs commands"| node_cli
node_caller -->|"requests tools"| node_mcp
node_rust_api -->|"identifies format"| node_format_detect
node_format_detect -->|"dispatches DOCX"| node_docx_reader
node_format_detect -->|"dispatches XLSX"| node_xlsx_reader
node_format_detect -->|"dispatches PPTX"| node_pptx_reader
node_format_detect -->|"dispatches DOC"| node_doc_reader
node_format_detect -->|"dispatches XLS"| node_xls_reader
node_format_detect -->|"dispatches PPT"| node_ppt_reader
node_doc_reader -->|"reads container"| node_cfb
node_xls_reader -->|"reads container"| node_cfb
node_docx_reader -->|"reads package"| node_opc
node_xlsx_reader -->|"reads package"| node_opc
node_pptx_reader -->|"reads package"| node_opc
node_opc -->|"uses parsing utilities"| node_xml_rels
node_docx_reader -->|"produces representation"| node_ir
node_doc_reader -->|"produces representation"| node_ir
node_xls_reader -->|"produces representation"| node_ir
node_rust_api -->|"returns IR"| node_ir
node_rust_api -->|"renders output"| node_render
node_rust_api -.->|"supports editing"| node_editing
node_docx_reader -->|"applies bounds"| node_limits
node_docx_reader -->|"uses preferences"| node_read_options
node_caller -->|"uses binding"| node_python
node_caller -->|"uses binding"| node_go
node_caller -->|"uses binding"| node_csharp
node_caller -->|"uses binding"| node_node
node_caller -->|"uses binding"| node_c_ffi
node_caller -->|"uses binding"| node_wasm
node_python -.->|"calls core"| node_rust_api
node_go -.->|"calls native interface"| node_c_ffi
node_csharp -.->|"calls native interface"| node_c_ffi
node_node -->|"calls native interface"| node_c_ffi
node_wasm -.->|"provides document API"| node_rust_api

click node_rust_api "https://github.com/yfedoseev/office_oxide/blob/main/src/lib.rs"
click node_cli "https://github.com/yfedoseev/office_oxide/blob/main/crates/office_oxide_cli/src/main.rs"
click node_mcp "https://github.com/yfedoseev/office_oxide/blob/main/crates/office_oxide_mcp/src/main.rs"
click node_format_detect "https://github.com/yfedoseev/office_oxide/blob/main/src/format.rs"
click node_docx_reader "https://github.com/yfedoseev/office_oxide/blob/main/src/convert_docx.rs"
click node_xlsx_reader "https://github.com/yfedoseev/office_oxide/blob/main/src/convert_xlsx.rs"
click node_pptx_reader "https://github.com/yfedoseev/office_oxide/blob/main/src/convert_pptx.rs"
click node_doc_reader "https://github.com/yfedoseev/office_oxide/blob/main/src/convert_doc.rs"
click node_xls_reader "https://github.com/yfedoseev/office_oxide/blob/main/src/convert_xls.rs"
click node_ppt_reader "https://github.com/yfedoseev/office_oxide/blob/main/src/convert_ppt.rs"
click node_cfb "https://github.com/yfedoseev/office_oxide/blob/main/src/cfb/reader.rs"
click node_opc "https://github.com/yfedoseev/office_oxide/blob/main/src/core/opc.rs"
click node_xml_rels "https://github.com/yfedoseev/office_oxide/blob/main/src/core/xml.rs"
click node_limits "https://github.com/yfedoseev/office_oxide/blob/main/src/limits.rs"
click node_read_options "https://github.com/yfedoseev/office_oxide/blob/main/src/read_options.rs"
click node_ir "https://github.com/yfedoseev/office_oxide/blob/main/src/ir.rs"
click node_render "https://github.com/yfedoseev/office_oxide/blob/main/src/ir_render.rs"
click node_editing "https://github.com/yfedoseev/office_oxide/blob/main/src/edit.rs"
click node_python "https://github.com/yfedoseev/office_oxide/tree/main/python/office_oxide"
click node_go "https://github.com/yfedoseev/office_oxide/blob/main/go/office_oxide.go"
click node_csharp "https://github.com/yfedoseev/office_oxide/blob/main/csharp/OfficeOxide/Document.cs"
click node_node "https://github.com/yfedoseev/office_oxide/blob/main/js/lib/index.js"
click node_c_ffi "https://github.com/yfedoseev/office_oxide/blob/main/src/ffi.rs"
click node_wasm "https://github.com/yfedoseev/office_oxide/blob/main/src/wasm.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_rust_api,node_cli,node_mcp toneBlue
class node_format_detect,node_docx_reader,node_xlsx_reader,node_pptx_reader,node_doc_reader,node_xls_reader,node_ppt_reader,node_cfb toneAmber
class node_opc,node_xml_rels,node_limits,node_read_options toneMint
class node_ir,node_render,node_editing toneRose
class node_python,node_go,node_csharp,node_node,node_c_ffi,node_wasm,node_caller toneIndigo
```

## Components

### User interfaces

- [Rust document API](https://github.com/yfedoseev/office_oxide/blob/main/src/lib.rs): `src/lib.rs`
- [Command-line interface](https://github.com/yfedoseev/office_oxide/blob/main/crates/office_oxide_cli/src/main.rs): `crates/office_oxide_cli/src/main.rs`
- [MCP server](https://github.com/yfedoseev/office_oxide/blob/main/crates/office_oxide_mcp/src/main.rs): `crates/office_oxide_mcp/src/main.rs`

### Format parsing

- [Format identification](https://github.com/yfedoseev/office_oxide/blob/main/src/format.rs): `src/format.rs`
- [DOCX reader](https://github.com/yfedoseev/office_oxide/blob/main/src/convert_docx.rs): `src/convert_docx.rs`
- [XLSX reader](https://github.com/yfedoseev/office_oxide/blob/main/src/convert_xlsx.rs): `src/convert_xlsx.rs`
- [PPTX reader](https://github.com/yfedoseev/office_oxide/blob/main/src/convert_pptx.rs): `src/convert_pptx.rs`
- [Legacy DOC reader](https://github.com/yfedoseev/office_oxide/blob/main/src/convert_doc.rs): `src/convert_doc.rs`
- [Legacy XLS reader](https://github.com/yfedoseev/office_oxide/blob/main/src/convert_xls.rs): `src/convert_xls.rs`
- [Legacy PPT reader](https://github.com/yfedoseev/office_oxide/blob/main/src/convert_ppt.rs): `src/convert_ppt.rs`
- [OLE container reader](https://github.com/yfedoseev/office_oxide/blob/main/src/cfb/reader.rs): `src/cfb/reader.rs`

### Shared processing

- [OOXML package reader](https://github.com/yfedoseev/office_oxide/blob/main/src/core/opc.rs): `src/core/opc.rs`
- [XML and relationships](https://github.com/yfedoseev/office_oxide/blob/main/src/core/xml.rs): `src/core/xml.rs`
- [Resource limits](https://github.com/yfedoseev/office_oxide/blob/main/src/limits.rs): `src/limits.rs`
- [Read preferences](https://github.com/yfedoseev/office_oxide/blob/main/src/read_options.rs): `src/read_options.rs`

### Results and editing

- [Document IR](https://github.com/yfedoseev/office_oxide/blob/main/src/ir.rs): `src/ir.rs`
- [Text and Markdown](https://github.com/yfedoseev/office_oxide/blob/main/src/ir_render.rs): `src/ir_render.rs`
- [Document editing](https://github.com/yfedoseev/office_oxide/blob/main/src/edit.rs): `src/edit.rs`

### Language bindings

- [Python binding](https://github.com/yfedoseev/office_oxide/tree/main/python/office_oxide): `python/office_oxide`
- [Go binding](https://github.com/yfedoseev/office_oxide/blob/main/go/office_oxide.go): `go/office_oxide.go`
- [C# binding](https://github.com/yfedoseev/office_oxide/blob/main/csharp/OfficeOxide/Document.cs): `csharp/OfficeOxide/Document.cs`
- [Node binding](https://github.com/yfedoseev/office_oxide/blob/main/js/lib/index.js): `js/lib/index.js`
- [C FFI](https://github.com/yfedoseev/office_oxide/blob/main/src/ffi.rs): `src/ffi.rs`
- [WASM binding](https://github.com/yfedoseev/office_oxide/blob/main/src/wasm.rs): `src/wasm.rs`

### Other components

- **Document consumer**

## Connections

- Document consumer → Rust document API: opens document (evidence: `README.md`)
- Document consumer → Command-line interface: runs commands (evidence: `README.md`)
- Document consumer → MCP server: requests tools (evidence: `README.md`)
- Rust document API → Format identification: identifies format (evidence: `src/lib.rs`)
- Format identification → DOCX reader: dispatches DOCX (evidence: `src/lib.rs`)
- Format identification → XLSX reader: dispatches XLSX (evidence: `src/lib.rs`)
- Format identification → PPTX reader: dispatches PPTX (evidence: `src/lib.rs`)
- Format identification → Legacy DOC reader: dispatches DOC (evidence: `src/lib.rs`)
- Format identification → Legacy XLS reader: dispatches XLS (evidence: `src/lib.rs`)
- Format identification → Legacy PPT reader: dispatches PPT (evidence: `src/lib.rs`)
- Legacy DOC reader → OLE container reader: reads container (evidence: `src/convert_doc.rs`)
- Legacy XLS reader → OLE container reader: reads container (evidence: `src/convert_xls.rs`)
- DOCX reader → OOXML package reader: reads package (evidence: `src/convert_docx.rs`)
- XLSX reader → OOXML package reader: reads package (evidence: `src/xlsx/mod.rs`)
- PPTX reader → OOXML package reader: reads package (evidence: `src/pptx/mod.rs`)
- OOXML package reader → XML and relationships: uses parsing utilities (evidence: `src/core/opc.rs`)
- DOCX reader → Document IR: produces representation (evidence: `src/convert_docx.rs`)
- Legacy DOC reader → Document IR: produces representation (evidence: `src/convert_doc.rs`)
- Legacy XLS reader → Document IR: produces representation (evidence: `src/convert_xls.rs`)
- Rust document API → Document IR: returns IR (evidence: `README.md`)
- Rust document API → Text and Markdown: renders output (evidence: `README.md`)
- Rust document API → Document editing: supports editing (evidence: `src/lib.rs`)
- DOCX reader → Resource limits: applies bounds (evidence: `src/convert_docx.rs`)
- DOCX reader → Read preferences: uses preferences (evidence: `src/convert_docx.rs`)
- Document consumer → Python binding: uses binding (evidence: `README.md`)
- Document consumer → Go binding: uses binding (evidence: `README.md`)
- Document consumer → C# binding: uses binding (evidence: `README.md`)
- Document consumer → Node binding: uses binding (evidence: `README.md`)
- Document consumer → C FFI: uses binding (evidence: `README.md`)
- Document consumer → WASM binding: uses binding (evidence: `README.md`)
- Python binding → Rust document API: calls core
- Go binding → C FFI: calls native interface
- C# binding → C FFI: calls native interface
- Node binding → C FFI: calls native interface (evidence: `README.md`)
- WASM binding → Rust document API: provides document API (evidence: `src/lib.rs`)
