Skip to main content

excel-grapher

Build and analyze dependency graphs from Excel workbooks, evaluate formulas with Excel semantics, and export standalone Python code.

Documentation: https://teal-insights.github.io/excel-grapher/

Why this exists

  • Transpilation support: trace formula dependencies to enable Excel → Python translation.
  • Interpretability: visualize and sanity-check spreadsheet logic (GraphViz, Mermaid, NetworkX).
  • Performance-minded: focuses on targeted dependency closure from specific output cells/ranges.
  • Excel semantics in Python: run workbook logic in-process with a full Excel-like evaluator.
  • Exportable: emit standalone Python packages that embed only the runtime surface you need.

Library layout

The unified distribution is excel-grapher and exposes a single import package, excel_grapher, with five main subpackages:

  • excel_grapher/core/ — shared semantic types, coercions, and scalar operators.
  • excel_grapher/runtime/ — Excel-equivalent function implementations and runtime semantics.
  • excel_grapher/grapher/ — workbook loading, graph extraction, Excel write-back, and visualization logic.
  • excel_grapher/evaluator/FormulaEvaluator: an Excel emulator for recomputing formulas in the extracted graph in Python.
  • excel_grapher/exporter/CodeGenerator: an transpiler for exporting the extracted graph as a standalone Python library.

Typical imports:

from excel_grapher.grapher import create_dependency_graph, DependencyGraph
from excel_grapher.evaluator import FormulaEvaluator
from excel_grapher.exporter import CodeGenerator
from excel_grapher.core import XlError  # and other shared types, if needed

Installation

Released under the MIT license. Install from GitHub:

Using uv (recommended):

# Basic install (NumPy-free)
uv add git+https://github.com/Teal-Insights/excel-grapher

# With vectorized operator / SUMPRODUCT acceleration
uv add "excel-grapher[fast] @ git+https://github.com/Teal-Insights/excel-grapher"

# With NetworkX support
uv add "excel-grapher[networkx] @ git+https://github.com/Teal-Insights/excel-grapher"

# With all optional dependencies (includes `fast`)
uv add "excel-grapher[all] @ git+https://github.com/Teal-Insights/excel-grapher"

Using pip:

pip install git+https://github.com/Teal-Insights/excel-grapher

# With extras:
pip install "excel-grapher[fast] @ git+https://github.com/Teal-Insights/excel-grapher"
pip install "excel-grapher[networkx] @ git+https://github.com/Teal-Insights/excel-grapher"
pip install "excel-grapher[all] @ git+https://github.com/Teal-Insights/excel-grapher"

The default install is correct without NumPy. Install the fast extra when evaluating large workbooks and you want vectorized operator / SUMPRODUCT acceleration. Exported standalone code stays NumPy-free either way.


High-level usage

The library supports a three-stage pipeline, plus Excel write-back of the same graph views used for Python export:

  1. Build a dependency graph from an Excel workbook (excel_grapher.grapher).
  2. Evaluate formulas with Excel semantics over that graph (excel_grapher.evaluator.FormulaEvaluator).
  3. Export standalone Python (excel_grapher.exporter.CodeGenerator) and/or a new .xlsx from the same GraphReadView (excel_grapher.grapher.write_workbook).

A minimal end‑to‑end example:

from pathlib import Path

from excel_grapher.grapher import create_dependency_graph, write_workbook
from excel_grapher.evaluator import FormulaEvaluator
from excel_grapher.exporter import CodeGenerator

workbook_path = Path("model.xlsx")
targets = ["Sheet1!A10"]

# 1) Build a dependency graph
graph = create_dependency_graph(workbook_path, targets, load_values=True)
print(len(graph))  # number of visited nodes

# 2) Evaluate with Excel semantics
with FormulaEvaluator(graph) as ev:
    results = ev.evaluate(targets)

# 3a) Export standalone Python code
code = CodeGenerator(graph).generate(targets)

# 3b) Write a new workbook from the graph (or a ProjectionResult)
write_workbook(graph, Path("edited.xlsx"))

Series bindings

Optional sidecar manifests (.bindings.yaml) declare structured input/output APIs for exported code — set_* and compute_* functions over Records. Validate sidecars from the shell with excel-grapher bindings validate. See the Series bindings guide and Code export guide.

User guide

Detailed documentation lives in the User Guide:

Topic Page
Dependency graphs Read guide
Visualization Read guide
Formula evaluation Read guide
End-to-end demo Read guide
Series bindings Read guide
Code export Read guide
Parity testing Read guide
Contributing Read guide

Examples

Hands-on walkthroughs (Markdown on GitHub):

Topic Walkthrough
Graph extraction extraction_basics.md
Code generation codegen_basics.md
Series bindings series_bindings.md
Induced graph induced_graph.md

Download files

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

Source Distribution

excel_grapher-11.1.0.tar.gz (5.9 MB view details)

Uploaded Source

Built Distribution

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

excel_grapher-11.1.0-py3-none-any.whl (431.6 kB view details)

Uploaded Python 3

File details

Details for the file excel_grapher-11.1.0.tar.gz.

File metadata

  • Download URL: excel_grapher-11.1.0.tar.gz
  • Upload date:
  • Size: 5.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for excel_grapher-11.1.0.tar.gz
Algorithm Hash digest
SHA256 409aa06f5253ca4d8e643a31fc4fa6c52642e4d49b75c5a29e3eeb3cf125d9be
MD5 e3fc8ad43c613ea78bd3b20d3c7e75e8
BLAKE2b-256 d21a94cbbfa2e332c5b57a37b135864ccc51598c80885d4c29cad467ad3fb28c

See more details on using hashes here.

Provenance

The following attestation bundles were made for excel_grapher-11.1.0.tar.gz:

Publisher: publish.yml on Teal-Insights/excel-grapher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file excel_grapher-11.1.0-py3-none-any.whl.

File metadata

  • Download URL: excel_grapher-11.1.0-py3-none-any.whl
  • Upload date:
  • Size: 431.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for excel_grapher-11.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 00ee17f57c51cd33a04beb4726eceb694bb0912c4fda00eba11466630264b87a
MD5 24a00ec35210613e626c2b8d65675f08
BLAKE2b-256 0303c23d0bfc1449620bc0c0e6ec784d11a1d3f3a02dd89c881cb66e01cd76f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for excel_grapher-11.1.0-py3-none-any.whl:

Publisher: publish.yml on Teal-Insights/excel-grapher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

11.3.0

2 files

11.2.0

2 files

This release

11.1.0 This release

2 files

11.0.0

2 files

10.3.0

2 files

10.2.0

2 files

10.1.0

2 files

10.0.0

2 files

9.1.0

2 files

9.0.0

2 files

8.0.0

2 files

7.0.0

2 files

6.3.3

2 files

6.3.2

2 files

6.3.1

2 files

6.3.0

2 files

6.2.0

2 files

6.1.2

2 files

6.1.1

2 files

6.1.0

2 files

6.0.0

2 files

5.2.0

2 files

5.1.6

2 files

5.1.5

2 files

5.1.4

2 files

5.1.3

2 files

5.1.2

2 files

5.1.1

2 files

5.1.0

2 files

5.0.0

2 files

4.1.2

2 files

4.1.1

2 files

4.1.0

2 files

4.0.2

2 files

4.0.1

2 files

4.0.0

2 files

3.21.2

2 files

3.21.1

2 files

3.21.0

2 files

3.20.2

2 files

3.20.1

2 files

3.20.0

2 files

3.19.1

2 files

3.19.0

2 files

3.18.0

2 files

3.17.1

2 files

3.17.0

2 files

3.16.0

2 files

3.15.3

2 files

3.15.2

2 files

3.15.1

2 files

3.15.0

2 files

3.14.1

2 files

3.14.0

2 files

3.13.1

2 files

3.13.0

2 files

3.12.0

2 files

3.11.0

2 files

3.10.1

2 files

3.10.0

2 files

3.9.0

2 files

3.8.0

2 files

3.7.0

2 files

3.6.0

2 files

3.5.0

2 files

3.4.3

2 files

3.4.2

2 files

3.4.1

2 files

3.4.0

2 files

3.3.0

2 files

3.2.0

2 files

3.1.0

2 files

3.0.1

2 files

3.0.0

2 files

2.5.2

2 files

2.5.1

2 files

2.5.0

2 files

2.4.1

2 files

2.4.0

2 files

2.3.0

2 files

2.2.0

2 files

2.1.3

2 files

2.1.2

2 files

2.1.1

2 files

2.1.0

2 files

2.0.0

2 files

1.2.0

2 files

1.1.0

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.6.9

2 files

0.6.7

2 files

0.6.6

2 files

0.6.4

2 files

0.6.3

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.1

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page