anydoc

anydoc

WHAT IS IT?

anydoc is a Rust library that takes an office document and hands back GitHub-Flavored Markdown. Word, PowerPoint, Excel, OpenDocument, RTF, EPUB, CSV and PDF all funnel through the same internal document model and the same serializer, so the output looks the same whatever went in. It ships as a Rust crate, an npm package, a Python wheel, a WebAssembly build and a CLI you reach through npx.

WHY IS IT INTERESTING?

  • One document model underneath: every format parser feeds the same structure of blocks, inlines, tables and notes. A table-escaping fix written for docx lands on rtf, odt and everything else at the same time.
  • Structure that actually survives: headings with anchors, nested lists that keep the source's own numbering, tables with merged cells, footnotes, endnotes and speaker notes. OMML, MathML and RTF equations come out as LaTeX $...$ and $$ math.
  • Format detection from content: the PDF header, the RTF open group, OLE stream names, the ZIP package mimetype. A mislabeled file still converts, except CSV, which has no marker and needs its extension or an explicit format.
  • Local by default: pure Rust, no ML models, no external services. The Rust crate never makes a network call. Only scanned PDFs, which fail with NeedsOcr, go out to Firecrawl Parse hosted OCR, and only when you opt in.
  • Bindings that keep out of the way: Node conversion runs on the libuv thread pool instead of blocking the event loop, and the Python binding releases the GIL. TypeScript types and Python stubs ship with the packages.
  • Typed, actionable errors: Unsupported, NeedsOcr with the offending page list, Malformed, Encrypted, ResourceLimit, MissingPart. Enough to set a file aside and move to the next one in a batch job.

USE CASES

  • Normalize a mixed pile of office documents before indexing them in a RAG pipeline
  • Convert files inside the browser through the WebAssembly build, with nothing leaving the machine
  • Give an agent the ability to read documents it runs into, via npx skills add firecrawl/anydoc
  • Pull Excel and OpenDocument tables into Markdown you can commit to a repository