Skip to main content

exporter.CodeGenerator

Generate inverted-tree packages from a DependencyGraph.

Usage

Source

exporter.CodeGenerator()

Package export is generate_modules() and requires series bindings.

Methods

Name Description
__init__() Initialize the code generator.
derive_input_series() Derive input-series metadata from explicit series bindings.
generate_modules() Generate a standalone package with explicit input-leaf computes.

__init__()

Initialize the code generator.

Usage

Source

__init__(graph)
Parameters
graph: DependencyGraph
Dependency graph covering the cells to export. A projection facade with original_graph is also accepted; export uses that original graph.

derive_input_series()

Derive input-series metadata from explicit series bindings.

Usage

Source

derive_input_series(bindings, *, workbook)

generate_modules()

Generate a standalone package with explicit input-leaf computes.

Usage

Source

generate_modules(*, series_bindings, bindings_workbook, blank_ranges=None)

Outputs come from the bindings catalog, not from a cell-address list.

Parameters
series_bindings: WorkbookSeriesBindings

Catalog of input, constant, internal, and output series.

bindings_workbook: Path | str

Workbook used to expand binding ranges.

blank_ranges: Sequence[str] | None = None
Sheet-qualified rectangles omitted from the graph that resolve as empty rather than unbound catalog cells.
Returns
dict[str, str]
Module filenames mapped to standalone Python source.