This repository contains 'officeParser', a robust Node.js and browser library for parsing 12 office document formats (DOCX, PPTX, XLSX, ODT, ODP, ODS, PDF, RTF, CSV, MD, HTML, EPUB) into a unified abstract syntax tree (AST) and generating high-fidelity output in 9 formats (JSON, text, Markdown, HTML, CSV, RTF, PDF, EPUB, and RAG-focused chunks). It provides a first-class CLI (`npx officeparser`) and a programmatic API (`parseOffice()` → AST → `.to(format, config?)`), with extensive configuration for OCR, chunking strategies, security limits, and format-specific dialects. The architecture follows a strict pipeline: format-specific parsers normalize documents into `OfficeParserAST`, then format-agnostic generators produce the desired output, enabling cross-format conversion and round-trip fidelity. The codebase demonstrates high craftsmanship with reusable utility modules (sanitization, typed error/warning systems, lazy ZIP handling, MathML-to-LaTeX conversion) and a comprehensive test suite covering parser baselines, generator baselines, security injection tests, and exhaustively tested edge cases. It supports browser and Node runtimes via dual CJS/ESM packages and bundled builds, including slim variants that minimize dependencies for browser environments. Key data flows include document metadata extraction, attachment handling (images, charts), OCR via Tesseract.js, PDF generation via Puppeteer, and semantic chunking for LLM ingestion. External dependencies include `pdfjs-dist`, `tesseract.js`, `fflate`, `chart.js`, and `puppeteer` (optional). While the repository is actively maintained with recent commits and CI across multiple Node versions, it shows some technical drift: deprecated API fields remain documented alongside replacements, and large files (e.g., OpenOfficeParser.ts at ~1600 lines) increase maintenance complexity. The builder has addressed past packaging issues (webpack context-module) and maintains sophisticated browser shims. Overall, it is a production-grade document conversion toolkit with exceptional reusability in its core utilities and a clean separation between parsing and generation.
Tablib is a Python library for working with tabular datasets in a format-agnostic way. It provides a core `Dataset` class that stores rows and optional headers, and a `Databook` class for collections of datasets. The library's primary functionality is converting between many structured data formats: CSV, TSV, JSON, YAML, Excel (XLS/XLSX), OpenDocument (ODS), dBase (DBF), HTML, Jira, LaTeX, reStructuredText, SQL INSERT statements, and pandas DataFrames. It also supports CLI table rendering via the `tabulate` package. The architecture is modular: each format is implemented as a class with `export_set`, `import_set`, `export_book`, `import_book`, and optionally `detect` methods. These are registered with a central `Registry` that also sets up dynamic property access on `Dataset` and `Databook` objects (e.g., `dataset.csv`, `dataset.json`). Lazy loading through importlib and string-based class references minimizes startup cost for optional formats like XLSX or YAML. The core `Dataset` object provides methods for row/column manipulation, sorting, filtering by tags, transposing, stacking, and applying formatters for custom cell transformations. Data flows are straightforward: users populate a `Dataset`, optionally set headers, then export to any registered format with a single `export()` call. Import reverses this process. Key entry points are `tablib.Dataset()`, `tablib.Databook()`, `tablib.import_set()`, `tablib.import_book()`, and `tablib.detect_format()`. The library has no hard runtime dependencies; all format-specific packages (openpyxl, xlrd, xlwt, odfpy, pyyaml, pandas, tabulate) are optional and requested via extras like `tablib[xlsx]` or `tablib[all]`. The vendored `dbfpy` module handles DBF format without external dependencies. Exception handling is structured with custom exception classes for invalid dimensions, unsupported formats, and missing headers.