scaffold()
Prepare the current Python session for work in the project.
Call it at the top of every notebook and script. It:
- finds the project root and loads its
.envand settings, - creates framework.db if needed and records the scaffold time,
- sets the random seed when
seed_on_scaffoldis on (orFW_SEEDis set), - puts the project's
functionsfolder on the import path, and - runs
scaffold.pyfrom the project root, if there is one.
Usage
scaffold(settings_file: str | Path | None = None) -> Path
Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| settings_file | str | Path | None | None |
The project's settings file. Default: the settings.yml or config.yml found in the current directory or its parents. |
Value
The project root.
Details
The working directory is not changed: Framework resolves project paths from the root wherever the notebook runs.
Raises
ProjectNotFoundError: When no settings file is found.