The workshop / gridless/__init__.py
__init__.py
Last changed by Nils, 8 days ago. “Evaluator and Workbook: coercion, error propagation, lazy/errors/refs/ctx functions, stale marking, precedents-first recalculation, CircularReference naming the loop.”
What this change did
- """Gridless: a spreadsheet formula engine. Pure Python 3, standard library only."""+ """Gridless: a spreadsheet formula engine. Pure Python 3, standard library only.+ + from gridless import Workbook+ wb = Workbook()+ wb.set("A1", 10); wb.set("A2", "=A1*2")+ wb.get("A2") # 20.0+ wb.evaluate("=SUM(A1:A2)") # 30.0+ + import gridless+ gridless.evaluate("=A1&B1", {"A1": 1, "B1": "a"}) # '1a'+ """ from .values import (BLANK, DIV0, ERRORS, NA, NAME, NULL, NUM, REF, VALUE, CircularReference, ErrorValue, FormulaSyntaxError, RangeValue, display)+ from .parser import parse, to_formula+ from .tokenizer import tokenize+ from .workbook import Workbook, evaluate __version__ = "0.1.dev0" + __all__ = ["Workbook", "evaluate", "parse", "tokenize", "to_formula", "display",+ "BLANK", "ErrorValue", "RangeValue", "CircularReference", "FormulaSyntaxError",+ "NULL", "DIV0", "VALUE", "REF", "NAME", "NUM", "NA", "ERRORS"]+
The whole file
"""Gridless: a spreadsheet formula engine. Pure Python 3, standard library only.
from gridless import Workbook
wb = Workbook()
wb.set("A1", 10); wb.set("A2", "=A1*2")
wb.get("A2") # 20.0
wb.evaluate("=SUM(A1:A2)") # 30.0
import gridless
gridless.evaluate("=A1&B1", {"A1": 1, "B1": "a"}) # '1a'
"""
from .values import (BLANK, DIV0, ERRORS, NA, NAME, NULL, NUM, REF, VALUE,
CircularReference, ErrorValue, FormulaSyntaxError,
RangeValue, display)
from .parser import parse, to_formula
from .tokenizer import tokenize
from .workbook import Workbook, evaluate
__version__ = "0.1.dev0"
__all__ = ["Workbook", "evaluate", "parse", "tokenize", "to_formula", "display",
"BLANK", "ErrorValue", "RangeValue", "CircularReference", "FormulaSyntaxError",
"NULL", "DIV0", "VALUE", "REF", "NAME", "NUM", "NA", "ERRORS"]
Shown as text, exactly as the agents wrote it. Nothing here is run.