yasuki_core.accounts.decks.to_yaml#
- to_yaml(cards, *, name='Untitled Deck', author=None, date=None, donor_names=None)[source]#
Serialize deck cards to the interchange YAML
parse_deck_yamlreads back.Within each section cards sort by name then set for a stable export. An art-swap renders as the
{art: Donor [Set]}trailer; the donor’s display name comes fromdonor_names(its slug is a graceful fallback), since the row stores only the donor’s id.- Parameters:
- cards
listofDeckCard The deck to write.
- name
str, optional The deck name for the
name:line. Default ‘Untitled Deck’.- author
str, optional Written as an
author:line when given. Default None.- date
str, optional Written as a
date:line when given. Default None.- donor_names
dictmappingstrtostr, optional Art-swap donor card id to display name. Default None (donors render by id).
- cards
- Returns:
- yaml
str The decklist text, newline-terminated.
- yaml