yasuki_core.install.yaml_to_sql.build_revisions#

build_revisions(original_text, errata)[source]#

Build a card’s ordered revision list from its original rules text and its errata entries.

Each errata entry is a dict with date and text, optionally source, source_url, art and set_slug (which resolve the revision’s image path), notes, and any integer stat overrides keyed by stat column. Revision 0 is the original text; errata follow sorted by effective date, so the last element is the current version.

Parameters:
original_textstr

The card’s pre-errata rules text.

erratalist of dict

The errata entries collected for the card, in any order.

Returns:
revisionslist of CardRevision

Revisions ordered oldest to newest, with the original at index 0.

Raises:
ValueError

If an errata entry has a missing or unparseable date. Unlike an original printing, an erratum without a datable effective date is a data error, not a legitimate null.