pyboxbuilder.cli.load_project

pyboxbuilder.cli.load_project(path: Path) → Project[source]

Import an insert script and hand back the Project it defines.

The script builds its project at import time and guards its own entry point with if __name__ == "__main__", so importing it is enough — and does not trigger an export of its own (see Examples Must Run In Both Plain Python and Jupyter in the plan).

Parameters:
path: Path

The insert script.

Returns:

The project it defines.

Raises:
  • ValueError – If the module defines no Project, or more than one, so there is nothing (or no one thing) to build.

  • ImportError – If the module cannot be imported.