>_EXECUTIVE SUMMARY
stryke-office is an opt-in package giving stryke native read+write across the office document landscape — Microsoft OOXML (xlsx/docx/pptx), OpenDocument (ods/odt/odp), PDF, and a full PIL-style raster image surface — with no LibreOffice/soffice subprocess.
Every format maps to a vendored Rust crate statically linked into the cdylib, so the artifact is self-contained: scp it and it runs.
~FORMAT → CRATE
Every format maps to a vendored, statically-linked Rust crate. There is no soffice / LibreOffice / pandoc / zint / ImageMagick subprocess anywhere in the chain.
| Concern | Implementation |
|---|---|
| spreadsheet read (xlsx / xls) | calamine (pure Rust) |
| spreadsheet read (ods) | native zip + quick-xml (calamine's ODS parser rejects pretty-printed content.xml) |
| xlsx write | rust_xlsxwriter |
| ods / odt / odp write | lo_odf (OpenDocument serializers) |
| docx write | docx-rs |
| docx / odt / pptx / odp read | native zip + quick-xml paragraph + structure extraction |
| pptx write | native zip + hand-built OOXML part set |
| pdf read + write | lo_core (self-contained, no font files) |
| pdf merge / split / rotate / info / encrypt / decrypt / compress | lopdf (pure-Rust core, default-features = false) |
| image read + write (all formats) | image |
| image drawing (shapes) | imageproc |
| image text drawing | ab_glyph + vendored assets/DejaVuSans.ttf |
| QR-code generation | qrcode (matrix only) |
| 1D barcode generation | barcoders (default-features = false, std) |
@FUNCTION FAMILIES
The Office namespace exposes 465 public functions. Each maps to a JSON-in/JSON-out export in the cdylib; the stryke wrapper (lib/Office.stk) serializes arguments and decodes responses.
| Family | Count | Surface |
|---|---|---|
| sheet_* | 175 | read/write + a dataframe-style analytics layer (group-by, pivot, join, stats, time-series, finance, sampling, type-coercion, export to csv/json/sql/latex/html) |
| img_* | 111 | PIL-complete handle-based image surface — open/save/convert, resize/crop/rotate, draw, filters, color science, distortions, animation, byte I/O |
| pdf_* | 47 | build/merge/split/rotate, encrypt/decrypt, forms, outline/bookmarks, annotations, attachments, stamps, search, stats |
| doc_* | 30 | read/write, structured blocks, tables, links, stats, readability, summary, diff, convert (md/html/pdf/slides/sheet) |
| slides_* | 26 | read/write, add image/text/notes, reorder, merge, stats, convert (doc/pdf/md/html/sheet) |
| text_* | 20 | plain-text toolkit — grep/sort/uniq/sed/cut/wrap/tr/paste/comm/join/shuf/base64/hash/redact/template |
| range_* / a1_* / r1c1_* / parse_* / *_to_* | 20 | A1 / R1C1 / range math — no workbook opened |
| chart_* | 5 | render/svg/save/from_sheet/grid — 60+ chart types, raster + vector |
| barcode_* | 4 | QR + 1D (code128/39/93/11, codabar, ean13/8, upca, itf, std2of5) → image handle |
| md_* / html_* / csv_* / *_to_sheet | ~15 | cross-format converters between csv/md/html/xml/json/ndjson and sheets/docs |
| meta_* / color_* / extract_images / mail_merge / info | ~10 | document metadata read/write/strip, color science, media extraction, mail-merge, universal file inspector |
$ARCHITECTURE
| Layer | Detail |
|---|---|
| stryke library | lib/Office.stk — 465 Office::* wrappers that serialize args to JSON, decode responses, map {error} to die |
| cdylib | libstryke_office.{dylib,so} — 465 office__* JSON-in/out exports, catch_unwind at the boundary, stryke_free_cstring for the return buffer |
| dispatch | format chosen from the path extension (override via format); reader/writer selected per kind |
| image handles | image ops return a numeric handle into an in-process table — open once, transform many times, then img_save / img_close (PIL-style) |
| build | Cargo cdylib, all deps pure Rust — no cmake, no system libraries, no soffice |
| tests | 426 Rust round-trip + contract tests (write then read back over a temp file) + a stryke assertion suite in t/ + 21 docs/readme lint gates in tests/ |
| CI | .github/workflows/ci.yml — fmt + clippy -D warnings + test on Linux/macOS, doc, release matrix |
/SCOPE & LIMITS
v0.18.0 covers structured read + write across the office document landscape plus PDF text generation, a dataframe-style spreadsheet analytics layer, a PIL-complete image surface, native chart rendering (raster + SVG), barcodes/QR, and cross-format conversion. The deliberate limit of the no-external-binary rule: there is no generic render-conversion (docx→pdf laid out like Word, xlsx→pdf), which fundamentally requires a layout/render engine. Conversions are intra-model (e.g. xlsx→ods via the shared cell model) and PDF is generated from a content model, not rasterized from a Word document.
Two further documented limitations — both crate limits, not faked: ODF (ods/odt) and PDF are written unstyled because the lo_odf / lo_core serializers do not expose per-run styling; and spreadsheet formula strings read back via formulas => 1 but are not evaluated (values are whatever the writing app computed). See the project Roadmap for the in-flight items (PowerPoint speaker-notes write, ODF per-run styling, legacy xls write).
$SOURCE MAP
| File | Role |
|---|---|
| src/lib.rs | office__* exports + spreadsheet / doc / slides / pdf handlers |
| src/tests.rs | 426 Rust round-trip + contract tests |
| src/doc_formats.rs | csv/tsv + html/md/rtf/txt readers + writers |
| src/doc_struct.rs | structured document reads (tables, blocks, links, stats) + merge/convert |
| src/pptx_write.rs | minimal OOXML PowerPoint writer |
| src/image_ops.rs | PIL-complete image I/O + manipulation |
| src/chart_render.rs | raster chart renderer (all chart types) |
| src/chart_svg.rs | vector (SVG / PDF) chart renderer |
| src/barcode.rs | QR + 1D barcode generation |
| src/meta_ops.rs | document metadata read / write (OOXML / ODF / PDF) |
| src/extract.rs | embedded media extraction (→ image handles) |
| src/textops.rs | template text search/replace (run-coalescing) |
| src/pdf_build.rs | multi-element paginated PDF document builder |
| src/pdf_ops.rs | PDF merge/split/rotate/info/encrypt/decrypt/compress (lopdf) |
| src/pdf_attach.rs / pdf_form.rs / pdf_outline.rs | PDF attachments, AcroForm fill, outline/bookmarks (lopdf) |
| lib/Office.stk | stryke wrapper (use Office) — 465 functions |
#PROJECT METADATA
| Item | Value |
|---|---|
| License | MIT |
| Author | MenkeTechnologies |
| Repository | github.com/MenkeTechnologies/stryke-office |
| Parent language | strykelang |
| Meta umbrella | MenkeTechnologiesMeta |