Skip to main content

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 key of the schema is unknown, a date is malformed or a vocabulary value is unknown.

Examples

from pathlib import Path
from tempfile import TemporaryDirectory

from babregen import make_sample_repo
from babregen.spec import load_decision

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