Skip to content

solvi.scaffold

solvi init: a new decision project.

solvi init: a new decision project — a small typed catalog, regression cases that pass, a README with the next steps, a CI workflow and a .gitignore.

solvi init [DIR] [--template support|refunds|minimal] [--with-model] [--force]

The catalog (catalog.py) has a computation, a hard check, a rule and — with --with-model — a question answered by a decider (a keyword stand-in by default, so tests and CI need no model; SOLVI_DECIDE_MODEL names a real one; a calibration file made with a real model is skipped, with a note, while the stand-in answers). cases.json pins its answers for solvi test; solvi check catalog.py:system lints it; solvi ask catalog.py:system example.json asks it once. Existing files are never overwritten without --force. Exit status: 0 — written; 1 — a file exists, or DIR is a file (nothing is written); 2 — usage errors.

files

files(target, template='support', with_model=False)

The files of a new project → {relative path: text}.

init

init(target='.', template='support', with_model=False, force=False)

Write a new project into target → the paths written. FileExistsError (nothing written; its first argument lists the files) when a file exists and force is False; NotADirectoryError when target is itself a file.

cmd_init

cmd_init(a)

solvi init (see solvi.cli) → exit status.