yasuki_core.accounts.decks#

Classes

DeckCard(card_id, card_name, side, quantity)

One normalized deck entry — a single (card, side, printing, art-variant) with its quantity.

DeckSummary(stronghold_card_id, clan, ...)

The denormalized summary the deck-tile / lobby list renders without joining deck_cards.

UnknownCardError(unknown)

A deck references cards absent from the card database.

Functions

assert_card_ids_known(cards, known_ids)

Raise UnknownCardError if any card or art-swap donor is not a real card id.

build_name_index(records)

Index card records by lowercased name and extended title, the keys a decklist resolves by.

deck_from_yaml(text, name_index)

Parse and resolve a YAML decklist in one step — the import-and-validate entry point.

from_rows(rows)

The deck cards reconstructed from deck_cards rows.

orphan_card_ids(stored_ids, known_ids)

The stored card ids absent from the card database — the post-rebuild integrity sweep.

resolve_deck_cards(parsed, name_index)

Resolve a parsed name-based decklist into validated, id-based deck cards.

stored_card_ids(conn)

Every card id referenced by any stored deck — cards and art-swap donors alike.

summarize(cards, records_by_id)

Derive the denormalized deck summary from its cards.

to_rows(cards, deck_id)

The deck_cards insert dicts for a deck's cards, keyed to deck_id.

to_yaml(cards, *[, name, author, date, ...])

Serialize deck cards to the interchange YAML parse_deck_yaml reads back.