yasuki_gui.ui.deck_builder.deck_io.serialize_deck#

serialize_deck(deck_state, repository, deck_name='', deck_author='', today=None)[source]#

Serialize a DeckState to the portable YAML decklist format.

Each deck section is grouped by card type with # Type (n) subheaders and counts (comments, skipped on import); name/author/date metadata heads the file.

Parameters:
deck_stateDeckState

Current deck composition.

repositoryDeckBuilderRepository

Card data lookup.

deck_namestr

Deck name to embed in the file. Default ‘’.

deck_authorstr

Deck author; omitted from the file when empty. Default ‘’.

todaystr, optional

ISO date for the date: line. Defaults to today.

Returns:
yamlstr

YAML-formatted decklist.