spec.load_decision

spec.load_decision(path)

Read one regen/decisions/<id>.toml provenance record.

Parameters

Name Type Description Default
path Path Path of the file. Its stem is the decision id. required

Returns

Name Type Description
Decision Decision The parsed record.

Raises

Name Type Description
SpecError If a required field is missing, a date is malformed or a vocabulary value is unknown.

Examples

from pathlib import Path
from tempfile import TemporaryDirectory

from spotregen import load_decision, make_sample_repo

with TemporaryDirectory() as tmp:
    root = make_sample_repo(Path(tmp) / "demo")
    decision = load_decision(root / "regen" / "decisions" / "why-add.toml")
    print(decision.id, decision.title)
why-add Addition is needed