Skip to content

notebook_template

sqllocks_spindle.fabric.notebook_template

Generate Fabric-compatible .ipynb notebooks for Spindle data generation.

Creates ready-to-run Jupyter notebooks that can be uploaded to Microsoft Fabric or run locally. Notebooks install Spindle, generate data for a domain, and optionally write to a Lakehouse.

Functions:

generate_notebook(domain, scale='small', seed=42, output_target='lakehouse')

Generate a ready-to-run Fabric notebook as a dict (ipynb format).

Parameters:

Name Type Description Default
domain str

Domain name (e.g. "retail", "healthcare").

required
scale str

Scale preset (small, medium, large, xlarge).

'small'
seed int

Random seed for reproducibility.

42
output_target str

Where to write output ("lakehouse", "display", "csv").

'lakehouse'

Returns:

Type Description
dict

A dict in Jupyter notebook (.ipynb) format.

save_notebook(notebook, output_path)

Save a notebook dict to a .ipynb file.

Parameters:

Name Type Description Default
notebook dict

Notebook dict from generate_notebook().

required
output_path str | Path

Path to write the .ipynb file.

required

Returns:

Type Description
Path

The Path where the file was written.