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)

Searching Database…

Что это?WorkbookLens — это инструмент с приоритетом локальной работы: он выполняет линтинг, регрессионное тестирование, семантическое сравнение и консервативное восстановление книг Excel, работая целиком на вашей машине без Excel, LibreOffice, ИИ-ключа или облачного сервиса.
Это десктопное приложение, CLI или и то и другое?И то и другое: для Windows есть фирменное оконное приложение (WorkbookLens.exe) на pywebview, плюс отдельный консольный CLI (WorkbookLensCLI.exe) и Python-пакет, которые точно так же работают на macOS и Linux.
Как его запустить?На Windows скачайте из GitHub Release подписанный установщик или портативный ZIP без установки и сверьте опубликованный SHA-256 перед запуском; на macOS/Linux используйте Python-пакет/CLI, поскольку десктопное приложение поставляется только для Windows.
Нужны ли Microsoft Excel или ИИ-ключ, чтобы им пользоваться?Нет — основные сценарии сканирования, тестирования, сравнения и восстановления OOXML полностью работают офлайн, без Excel, LibreOffice, ИИ-ключа и каких-либо облачных сервисов; Excel/LibreOffice используется лишь опционально, чтобы валидировать исправления, выведенные из формул, в файлах, которым вы явно доверяете.
Какие типы файлов и операции реально поддерживаются?Файлы xlsx поддерживают полное сканирование, тестирование, сравнение и консервативное восстановление, а файлы xlsm — только чтение; формулы никогда не вычисляются, а VBA/встроенные объекты/внешние ссылки никогда не выполняются.
Куда попадают данные моей книги?Всё остаётся на вашем компьютере — книги, созданные отчёты, языковые настройки и диагностические журналы не покидают машину, и никакой облачный сервис не задействован.
Что на самом деле гарантирует схема Patch Plan?Схема Patch Plan v3 фиксирует уникальность кандидата, доказательства его происхождения, сохраняемые инварианты и требования к пересчёту, поэтому исправление в один клик автоматически откатывается, если не проходит любая из проверок — пересчёт, повторное сканирование, зависимости или идемпотентность.
Можно ли запустить WorkbookLens в CI?Да, GitHub Action поддерживает режимы scan и test с YAML-конфигом и базовыми линиями для файлов xlsx/xlsm, а сам проект тестируется на Python 3.11-3.14 под Linux, Windows и macOS.
Может ли он выполнить формулы или макросы в моём файле?Нет, в обычных сценариях формулы никогда не вычисляются, VBA не запускается, встроенные объекты не открываются, внешние ссылки не загружаются — опциональная валидация через Excel/LibreOffice включается только после того, как вы явно пометите книгу как доверенную.
А как насчёт конвертации старых файлов .xls?Локальная конвертация .xls подчиняется тому же правилу «только доверенные файлы», что и валидация автоисправлений формул: она выполняется только для файлов, явно помеченных как доверенные, и никогда не обращается к облачным сервисам.
Size
1.2 MB
Stars
142
Age
2mo
Commits · 90 Days