Tools for converting spreadsheet workbooks into transparent Python models.
Project description
Modelwright
modelwright is an early-stage project for turning spreadsheet workbooks into transparent, version-controlled, standalone Python models.
The intended direction is a generic workflow that can inspect workbook structure, extract formulas and dependencies, generate maintainable Python source, and validate the generated model against the original workbook outputs.
This repository is currently an early implementation skeleton. It defines minimal Python package and test scaffolding plus initial validation, extraction, graph, generation, oracle records, and thin JSON command-line wrappers, but does not yet provide a release stability guarantee, catalog schema, or full workbook conversion.
Current Focus
- Build the first package-backed validation/report, workbook extraction, generation, and CLI cores.
- Keep extraction, code generation, validation, diagnostics, and reporting responsibilities separate.
- Avoid committing private notes, source workbooks, generated clones, or large artifacts while the project shape is still being established.
Python API Boundary
The durable API is organized by module responsibility:
modelwright.extraction: workbook extraction records andextract_workbook.modelwright.graph: dependency graph records andbuild_dependency_graph.modelwright.formulas: formula expression records, translation helpers, and reference-index helpers.modelwright.generation: generated-module records andgenerate_python_module.modelwright.validation: validation scenarios, scalar comparisons, and report records.modelwright.oracles,modelwright.formulas_oracle, andmodelwright.oracle_validation: oracle request/result records, optionalformulasoracle execution, and oracle-backed report assembly.
The package root modelwright exposes a curated convenience facade for those records and functions. Module-level imports remain preferred for implementation work because this project is still pre-release.
Command-Line Interface
Bootstrap the repo-local virtual environment before using the console script:
scripts/bootstrap_dev_env.sh
The current CLI prints JSON to stdout and stays close to the Python APIs:
modelwright workbook extract path/to/workbook.xlsx > tmp/extraction.json
modelwright workbook graph path/to/workbook.xlsx > tmp/dependency-graph.json
modelwright conversion plan path/to/workbook.xlsx > tmp/conversion-plan.json
modelwright model generate --contract tmp/contract.json --expressions tmp/expressions.json --constants tmp/constants.json --out tmp/generated_model.py > tmp/generation-result.json
modelwright validation report --scenario tests/fixtures/synthetic_model/baseline_scenario.json --generated-values tmp/generated-values.json --oracle-values tmp/oracle-values.json > tmp/validation-report.json
These commands do not provide a one-step workbook converter. conversion plan reports extraction, graphing, formula-translation, and residual-blocker status; model generate expects explicit generated-module and formula-expression JSON inputs; and validation report compares already-observed generated/oracle values. See planning/cli-json-workflows.md for JSON examples and workflow boundaries.
Local Development
Bootstrap a repo-local virtual environment:
scripts/bootstrap_dev_env.sh
This installs Modelwright with the dev extra:
.venv/bin/python -m pip install -e '.[dev]'
Run lint checks:
.venv/bin/python -m ruff check .
Run tests:
.venv/bin/python -m pytest
Build docs locally:
.venv/bin/sphinx-build -b html docs _build/html -W
.venv/bin/python scripts/verify_docs_theme.py _build/html
Restore the public external FABLE benchmark workbooks into ignored local paths:
scripts/bootstrap_dev_env.sh --benchmarks
modelwright is pre-release. The current alpha line is 0.1.0a6; alpha releases must not be described as full-workbook conversion guarantees.
Check release artifacts locally:
scripts/check_release_artifacts.sh
Release checks write build outputs under ignored tmp/release-checks/.
See docs/guides/release-deployment.rst for the release and deployment runbook.
Repository Conventions
AGENTS.mdis the working contract for AI coding agents.CONTRIBUTING.mdis the contributor onboarding and development workflow guide.ROADMAP.mdis the current plan and next-step tracker.CHANGE_LOG.mdis the append-only project narrative.planning/contains focused design notes and research records that are too detailed for the roadmap.benchmarks/contains tracked metadata for official external benchmarks; large workbook binaries remain untracked and are restored locally undertmp/.src/modelwright/contains the importable Python package.tests/contains package-backed tests and tracked synthetic fixture helpers.tmp/is ignored local working space for private notes, source workbooks, experiments, and generated scratch outputs.
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 modelwright-0.1.0a6.tar.gz.
File metadata
- Download URL: modelwright-0.1.0a6.tar.gz
- Upload date:
- Size: 2.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84d5c1d93d95bdd08f7e0c9416b11d9f5f636e80326d0aee397bc89836d365c7
|
|
| MD5 |
ea34091c91f423d97a3ebe3fc5207ab1
|
|
| BLAKE2b-256 |
2707f7f89576ff287349692b7749fa5cde32f1fbc08f5bfe346c068cc95a4366
|
Provenance
The following attestation bundles were made for modelwright-0.1.0a6.tar.gz:
Publisher:
release.yml on UBC-FRESH/modelwright
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
modelwright-0.1.0a6.tar.gz -
Subject digest:
84d5c1d93d95bdd08f7e0c9416b11d9f5f636e80326d0aee397bc89836d365c7 - Sigstore transparency entry: 1915940246
- Sigstore integration time:
-
Permalink:
UBC-FRESH/modelwright@3699baa523b6b80b404e946f94ebc9d17755484c -
Branch / Tag:
refs/tags/v0.1.0a6 - Owner: https://github.com/UBC-FRESH
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3699baa523b6b80b404e946f94ebc9d17755484c -
Trigger Event:
push
-
Statement type:
File details
Details for the file modelwright-0.1.0a6-py3-none-any.whl.
File metadata
- Download URL: modelwright-0.1.0a6-py3-none-any.whl
- Upload date:
- Size: 56.0 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 |
1a8ab5b4d4f1cabc871f94130a988315e551149be31e71971cbdd7bda1f3a284
|
|
| MD5 |
40bad71b93a73b3ea3c684d6da02ed23
|
|
| BLAKE2b-256 |
7c8637720b53a140b49906d808bcccde5b25a33f76a0dfbd1ddecbbacbdf32ac
|
Provenance
The following attestation bundles were made for modelwright-0.1.0a6-py3-none-any.whl:
Publisher:
release.yml on UBC-FRESH/modelwright
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
modelwright-0.1.0a6-py3-none-any.whl -
Subject digest:
1a8ab5b4d4f1cabc871f94130a988315e551149be31e71971cbdd7bda1f3a284 - Sigstore transparency entry: 1915940379
- Sigstore integration time:
-
Permalink:
UBC-FRESH/modelwright@3699baa523b6b80b404e946f94ebc9d17755484c -
Branch / Tag:
refs/tags/v0.1.0a6 - Owner: https://github.com/UBC-FRESH
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3699baa523b6b80b404e946f94ebc9d17755484c -
Trigger Event:
push
-
Statement type: