Build and analyze dependency graphs from Excel workbooks
Project description
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, 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
This is a proprietary package. Install from the private GitHub repository:
Using uv (recommended):
# Basic install
uv add 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
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[networkx] @ git+https://github.com/Teal-Insights/excel-grapher"
Note: You must have access to the Teal-Insights GitHub organization and appropriate SSH keys or tokens configured.
High-level usage
The library supports a three-stage pipeline:
- Build a dependency graph from an Excel workbook (
excel_grapher.grapher). - Evaluate formulas with Excel semantics over that graph (
excel_grapher.evaluator.FormulaEvaluator). - Export standalone Python code that embeds only the required runtime surface (
excel_grapher.exporter.CodeGenerator).
A minimal end‑to‑end example:
from pathlib import Path
from excel_grapher.grapher import create_dependency_graph
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)
# 3) Export standalone Python code
code = CodeGenerator(graph).generate(targets)
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 |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file excel_grapher-0.4.0.tar.gz.
File metadata
- Download URL: excel_grapher-0.4.0.tar.gz
- Upload date:
- Size: 373.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
041471826bae9850e91bf5a76747fe01e078ca5b1fc699fe73554654494e590a
|
|
| MD5 |
ed216f99e81962f295f18a4e6a3fcceb
|
|
| BLAKE2b-256 |
d22b7762c7414b56e714f3d8d61debcbd8e3701148fa2ce469b9da1b82820541
|
Provenance
The following attestation bundles were made for excel_grapher-0.4.0.tar.gz:
Publisher:
publish.yml on Teal-Insights/excel-grapher
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
excel_grapher-0.4.0.tar.gz -
Subject digest:
041471826bae9850e91bf5a76747fe01e078ca5b1fc699fe73554654494e590a - Sigstore transparency entry: 1862998983
- Sigstore integration time:
-
Permalink:
Teal-Insights/excel-grapher@57367f7a226ad955127c43b42e0707e178cfe412 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Teal-Insights
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@57367f7a226ad955127c43b42e0707e178cfe412 -
Trigger Event:
push
-
Statement type:
File details
Details for the file excel_grapher-0.4.0-py3-none-any.whl.
File metadata
- Download URL: excel_grapher-0.4.0-py3-none-any.whl
- Upload date:
- Size: 244.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a62048f581830ad6c971a92800c769bb21540375ee0838cb503d9814522f586b
|
|
| MD5 |
521b788ecc182471e05052e09ec3d629
|
|
| BLAKE2b-256 |
7d5e8ae60095a71f48fdfa9af9f2fec37714d966283ee2743a1cb77462b42c53
|
Provenance
The following attestation bundles were made for excel_grapher-0.4.0-py3-none-any.whl:
Publisher:
publish.yml on Teal-Insights/excel-grapher
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
excel_grapher-0.4.0-py3-none-any.whl -
Subject digest:
a62048f581830ad6c971a92800c769bb21540375ee0838cb503d9814522f586b - Sigstore transparency entry: 1862999227
- Sigstore integration time:
-
Permalink:
Teal-Insights/excel-grapher@57367f7a226ad955127c43b42e0707e178cfe412 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Teal-Insights
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@57367f7a226ad955127c43b42e0707e178cfe412 -
Trigger Event:
push
-
Statement type: