workbooklens README

The project's README from github.com/chenweixin123/workbooklens. As one markdown file: README.md.

WorkbookLens

Deterministic linting, regression testing, semantic diffing, and conservative repair for Excel workbooks.

WorkbookLens 2.4 core scan, test, diff, and direct OOXML repair workflows work locally without Microsoft Excel, LibreOffice, an AI key, or a cloud service. Those normal workflows do not calculate formulas, execute VBA, open embedded objects, or fetch external links. .xlsx files support scan, test, diff, and conservative repair; .xlsm files remain read-only. Formula-derived auto-repair can optionally validate isolated temporary copies with Microsoft Excel (preferred) or LibreOffice, but only after the user explicitly marks the workbook as trusted. The installed application may evaluate WEBSERVICE, data connections, or other workbook-defined behavior, so leave that authorization off for untrusted files; lossless normalization still works and formula candidates are skipped. Local .xls conversion is the same kind of trusted-file-only boundary. Neither path uses a cloud service.

Release status: GitHub Releases are authoritative for source archives and attached artifacts. Version 2.4.0 may not be published to PyPI; use the downloaded wheel or source checkout instructions below unless PyPI explicitly lists that version. Do not assume pipx or uvx can install a GitHub-only release by package name.

What is new in 2.4

What is new in 2.3

What is new in 2.2

What is new in 2.1

What was new in 2.0

For the normal Windows experience, download WorkbookLens-2.4.0-windows-x64-setup.exe and SHA256SUMS from the official GitHub Release. Verify the published checksum before running the installer:

(Get-FileHash .\WorkbookLens-2.4.0-windows-x64-setup.exe -Algorithm SHA256).Hash

The installer uses the current Windows account and does not require administrator access. Its wizard provides the normal Install button, adds WorkbookLens to the Start menu, offers a desktop shortcut by default, and registers a standard entry in Windows Installed apps. Open the Start-menu or desktop shortcut to launch the local WorkbookLens window directly. The application uses pywebview with the Microsoft Edge WebView2 Runtime to render its loopback-only interface; it does not show a console or open an external browser. Closing the desktop window stops its background server cleanly. The language selector offers Chinese and English and remembers the choice locally.

Uninstall from Windows Settings > Apps > Installed apps, or choose Uninstall WorkbookLens in the WorkbookLens Start-menu folder. The installer and application are currently unsigned, so Microsoft SmartScreen may display an unfamiliar-app warning. Download only from the official release and verify the SHA-256 value; do not disable antivirus protection. The installed application exposes the same local scan, repair, report, and optional .xls conversion interface as the portable build.

Windows portable ZIP

The official WorkbookLens-2.4.0-windows-x64-portable.zip is the no-install Windows option. It bundles a 64-bit CPython 3.12 runtime, so users do not need to install Python, uv, Microsoft Excel, LibreOffice, an AI key, or a cloud client. It is a portable folder rather than an installer: it does not request administrator access, modify the registry, create file associations, or add an automatic updater.

Download the ZIP and SHA256SUMS from the official GitHub Release, compare the published SHA-256 value, and extract the complete folder. In PowerShell:

(Get-FileHash .\WorkbookLens-2.4.0-windows-x64-portable.zip -Algorithm SHA256).Hash
Expand-Archive .\WorkbookLens-2.4.0-windows-x64-portable.zip -DestinationPath .\WorkbookLens
Set-Location .\WorkbookLens\WorkbookLens-2.4.0-windows-x64
.\Start-WorkbookLens.cmd

The launcher starts the no-console WorkbookLens.exe desktop application. Its background service listens only on 127.0.0.1, prefers port 8765, and selects an available local port if that port is already in use. The interface opens inside the WorkbookLens window through Edge WebView2 rather than an external browser, and closing the window stops the service cleanly. Workbook files, generated reports, language settings, and diagnostic logs stay on the computer; the portable runtime does not upload them. WorkbookLensCLI.exe remains available in the same folder for command-line workflows.

The local home page also offers Convert to .xlsx for legacy binary .xls workbooks. Conversion is enabled only when WorkbookLens detects Microsoft Excel or LibreOffice on that computer. Excel is preferred for fidelity; LibreOffice is a fallback. Macros and events are disabled for the automated Excel open, external links are not updated, and the generated file must pass the same bounded OOXML safety inspection used by normal WorkbookLens inputs before it is downloaded. Conversion can still change unsupported legacy features, cached formula results, fonts, print layout, or vendor-specific objects, so review the .xlsx copy before relying on it.

The executable is currently unsigned, so Microsoft SmartScreen may display a warning. Verify the checksum and download only from the official release. The portable build guarantees the built-in rules; install the wheel in a normal Python environment when third-party entry-point plugins are required.

Install the downloaded wheel

The .whl attached to the GitHub Release is a local Python application package, not a hosted upload service. Workbook processing stays on the user's computer. Installing the wheel may contact the configured Python package index once to obtain dependencies; scanning, planning, repair, diff, and the loopback web UI do not upload workbooks.

Download workbooklens-2.4.0-py3-none-any.whl, workbooklens-2.4.0.tar.gz, and SHA256SUMS from the official GitHub Release, verify the checksum, and install it with Python 3.11+ and uv.

PowerShell

Get-Content .\SHA256SUMS
(Get-FileHash .\workbooklens-2.4.0-py3-none-any.whl -Algorithm SHA256).Hash
uv tool install .\workbooklens-2.4.0-py3-none-any.whl
workbooklens --version
workbooklens serve --port 8765

Bash

grep -E '  workbooklens-2\.4\.0-py3-none-any\.whl$' SHA256SUMS | sha256sum -c -
grep -E '  workbooklens-2\.4\.0\.tar\.gz$' SHA256SUMS | sha256sum -c -
uv tool install ./workbooklens-2.4.0-py3-none-any.whl
workbooklens --version
workbooklens serve --port 8765

Then open http://127.0.0.1:8765/. The browser page and temporary upload directory are local to that process. Sensitive workbooks should use the CLI or this loopback UI rather than a hosted CI runner.

The setup executable, portable ZIP, and wheel are distributions of the same local application. The installer is the normal Windows option, the portable ZIP makes no installation changes, and the wheel is the extensible option for Python users.

Install from this source checkout

WorkbookLens requires Python 3.11 or newer and uv.

Bash

git clone https://github.com/chenweixin123/workbooklens.git
cd workbooklens
uv sync --locked
uv run workbooklens --version
uv run workbooklens demo --out .artifacts/demo

PowerShell

git clone https://github.com/chenweixin123/workbooklens.git
Set-Location workbooklens
uv sync --locked
uv run workbooklens --version
uv run workbooklens demo --out .artifacts/demo

If PyPI lists version 2.4.0, isolated installation is:

uvx --from workbooklens==2.4.0 workbooklens --help
pipx install workbooklens==2.4.0

Core workflows

# Self-contained HTML, JSON, snapshot, and SARIF
workbooklens scan INPUT.xlsx --out report/

# Optional YAML rule configuration
workbooklens scan INPUT.xlsx --config workbooklens.yml --out report/

# Gate only findings absent from an earlier report
workbooklens scan INPUT.xlsx --baseline previous/findings.json --new-only --fail-on warning --out report/

# Pin a portable logical path when invoking from varying working directories
workbooklens scan INPUT.xlsx --source-scope models/INPUT.xlsx --baseline previous/findings.json --new-only --out report/

# Preview and apply source-bound deterministic repairs to a new file
workbooklens plan INPUT.xlsx --config workbooklens.yml --out repair-plan.json
workbooklens apply INPUT.xlsx repair-plan.json --patch-id patch-0123456789abcdef --out INPUT.fixed.xlsx
workbooklens apply INPUT.xlsx repair-plan.json --safe-only --out INPUT.fixed.xlsx

# Apply lossless repairs and validate unique formula candidates from a trusted workbook
workbooklens apply INPUT.xlsx repair-plan.json --auto-repair --recalc-provider auto \
  --trust-workbook --out INPUT.auto-fixed.xlsx

# Apply an explicitly reviewed layout patch or atomic layout group
workbooklens apply INPUT.xlsx repair-plan.json --patch-id patch-fedcba9876543210 --accept-layout-risk --out INPUT.layout-fixed.xlsx

# Semantic before/after comparison
workbooklens diff BEFORE.xlsx AFTER.xlsx --out diff.html

# Bounded YAML assertions and finding-count gates
workbooklens test INPUT.xlsx --config workbooklens.yml --out test-results.json

# Loopback-only local review UI
workbooklens serve --port 8765

PowerShell uses the same arguments:

workbooklens scan INPUT.xlsx --baseline previous\findings.json --new-only --fail-on warning --out report

--new-only requires --baseline. A findings.json baseline is bound to its source_scope (normally the input path relative to the current directory), so a report for one workbook cannot silently hide a finding in another. Without --new-only, reports retain all current findings while identifying which were already known. Reusing a --new-only report preserves both its new and previously known IDs.

Optional Workbook Profile

Some spreadsheet mistakes cannot be proved from layout alone. An optional version-3 YAML profile lets a user declare field roles, constraints, and repair policy without sending the workbook anywhere:

version: 3
profile:
  infer_semantics: true
  report_trailing_whitespace: true
  review_trailing_whitespace_patches: false
  sheets:
    - sheet: Invoices
      range: A1:G10000
      header_row: 1
      columns:
        - header: Invoice ID
          role: identifier
          repair: report
          required: true
          identifier_width: 8
          preserve_leading_zeros: true
        - header: Status
          role: category
          required: true
          allowed_values: [Open, Paid, Void]
        - header: Customer Email
          role: email
        - header: Amount
          role: currency
          repair: auto
        - header: Tax Rate
          role: percentage
          repair: review

Supported roles are identifier, category, email, phone, currency, percentage, date, number, and text. Select a field by header or bounded Excel column. Version 3 adds repair: auto | review | report: auto still requires a unique parse, stable native peers, no leading-zero risk, and all postconditions; review emits a semantic-review candidate; report never emits a patch. Profile rules report missing required values, invalid enumerations or contact formats, possible lost leading zeros, trailing whitespace, and number-format role conflicts. They never invent business values. Versions 1 and 2 remain readable and retain their earlier beh

workbooklens (chenweixin123/workbooklens)

data-validation
Searching Database…

What is this?WorkbookLens is a local-first tool that lints, regression-tests, semantic-diffs, and conservatively repairs Excel workbooks, running entirely on your machine without Excel, LibreOffice, an AI key, or a cloud service.
Is this a desktop app, a CLI, or both?Both: Windows ships a branded windowed app (WorkbookLens.exe) built with pywebview, plus a separate console CLI (WorkbookLensCLI.exe) and a Python package that work the same way on macOS and Linux.
How do I get it running?On Windows, download the signed installer or the no-install portable ZIP from the GitHub Release and verify the published SHA-256 before running it; on macOS/Linux you use the Python package/CLI since the packaged desktop app is Windows-only.
Do I need Microsoft Excel or an AI key to use it?No — the core scan, test, diff, and OOXML repair workflows run fully offline without Excel, LibreOffice, an AI key, or any cloud service; Excel/LibreOffice is only used optionally to validate formula-derived repairs on files you explicitly trust.
What file types and operations are actually supported?xlsx files support full scan, test, diff, and conservative repair, while xlsm files are read-only; formulas are never calculated and VBA/embedded objects/external links are never executed.
Where does my workbook data go?Everything stays on your computer — workbooks, generated reports, language settings, and diagnostic logs never leave the machine, and no cloud service is involved.
What does the Patch Plan schema actually guarantee?Patch Plan schema v3 records candidate uniqueness, derivation evidence, preserved invariants, and recalculation requirements, so a one-click repair rolls back automatically if any recalculation, rescan, dependency, or idempotency check fails.
Can I run WorkbookLens in CI?Yes, a GitHub Action supports scan or test modes with YAML config and baselines for xlsx/xlsm files, and the project itself tests Python 3.11-3.14 on Linux, Windows, and macOS.
Will it ever execute formulas or macros on my file?No, normal workflows never calculate formulas, run VBA, open embedded objects, or fetch external links — optional Excel/LibreOffice validation only kicks in after you explicitly mark a workbook as trusted.
What about converting old .xls files?Local .xls conversion follows the same trusted-file-only rule as formula auto-repair validation: it only runs on files you have explicitly marked trusted, and it never touches a cloud service.
Size
1.2 MB
Stars
142
Age
2mo
Commits · 90 Days