Skip to main content

linexcel

PyPI License: MIT CI Docs

Data lineage analysis for Excel workbooks.

Extracts every formula, groups stretched patterns (R1C1 canonicalization), builds a dependency graph (cells, ranges, defined names, VBA), decomposes composite functions with step-by-step evaluation, and optionally documents calculations via the AI provider of your choice.

Dependency graph of a workbook

Install

uv add linexcel               # pip install linexcel
uv add linexcel[ai]           # + AI documentation (optional)

Note: linexcel depends on formualizer, a Rust-based spreadsheet engine. Prebuilt wheels are available for Linux, macOS, and Windows. If no wheel matches your platform, a Rust toolchain is required to build from source.

Usage

from linexcel import analyze

result = analyze("workbook.xlsx")
result                        # interactive graph in marimo / Jupyter
result.save_html("out.html")  # standalone offline HTML viewer
result.stats                  # {totalFormulas, totalNodes, ...}
result.warnings               # list[str]

Everything above is local and needs no key. AI documentation is optional, and you choose the provider — nothing is sent anywhere until you name one:

# A local runtime keeps the workbook on your machine and costs nothing
docs = result.document(base_url="http://localhost:11434/v1", model="llama3.1")
overview = result.document_workbook(base_url="http://localhost:11434/v1", model="llama3.1")
result.save_html("out.html", docs=docs, workbook_doc=overview, language="en")

Any OpenAI-compatible endpoint works the same way — a local Ollama or vLLM runtime, a gateway such as OpenRouter, a vendor's own API — and provider= takes any callable for anything else. See Choosing an AI provider.

Features

  • Formula extraction via formualizer (Rust engine)
  • Stretched pattern grouping — 1000 identical formulas → 1 node
  • Dependency graph — cells, ranges, defined names, VBA procedures
  • Step-by-step evaluation — each operator/function evaluated individually
  • Standalone HTML viewer — Cytoscape.js embedded, fully offline, keyboard-navigable, light by default with a dark toggle
  • Values you can check — each figure states whether it was read from the workbook or recalculated by linexcel, and shows both side by side when the file disagrees
  • Workbook context — sheet previews, comments, merged ranges, frozen panes and hidden columns, plus optional LibreOffice-rendered screenshots
  • AI documentation — vendor-neutral, grounded in deterministic lineage, with token accounting and a spend ceiling
  • Nine interface languages — for both the report and the AI prompts

Documentation

Guide
Quick start Analyse a workbook, explore it, export it
Lineage coverage What is in the graph, and what is not
HTML export The standalone offline report
Workbook context & screenshots What a reader sees, not only what the file computes
Choosing an AI provider Ollama, OpenRouter, any OpenAI-compatible endpoint, or your own callable
AI documentation Provable cards, token usage, token_budget=
Languages The nine supported locales
Data handling What leaves the machine, and when
API reference LineageResult, analyzer, aidoc, …

Sample output

Every image below is captured from a real report by scripts/capture_viewer.py, so they cannot drift from the viewer without the readme-shots commit hook noticing.

A node, documented

Formula, step-by-step evaluation, precedents and dependents, and the AI card written from that same deterministic dossier.

A node selected in the viewer

Workbook overview

AI-written workbook overview

Sheet context

Each sheet rendered whole, over a grid of its first cells, alongside its comments, frozen panes, merged ranges and hidden columns.

Sheet context tab

Security

Analysis is entirely local. AI documentation sends dossiers only to the provider you configure — see Data handling.

Please report vulnerabilities privately according to SECURITY.md. Do not include sensitive workbooks or credentials in public issues.

Changelog

See CHANGELOG.md.

License

MIT — see LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

linexcel-1.0.0.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

linexcel-1.0.0-py3-none-any.whl (315.9 kB view details)

Uploaded Python 3

File details

Details for the file linexcel-1.0.0.tar.gz.

File metadata

  • Download URL: linexcel-1.0.0.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for linexcel-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5a51751f6caaab42fdcd395418b920a72eb48f12a18cf14bd654b056e23ff02b
MD5 0ac6835758bb99f1f9b6dd11475d5854
BLAKE2b-256 8e158c7a9e4cdea2c1545f03b04d58285e3f77def7a2a21f0072087ff653d7e2

See more details on using hashes here.

File details

Details for the file linexcel-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: linexcel-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 315.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for linexcel-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b87494673387a5c78615e93c21f177c3f0d0405a30a6d94b53cb7287f7378203
MD5 198ec6a146230beb02cd0cd4d88b23c5
BLAKE2b-256 c36be8e924628dd4bb3ff548e18a56054f7bdec26f28518639e0dd02a6af0085

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page