Deck is a named collection of Flashcard objects. Decks are the primary unit of persistence — saved to decks.json on the desktop and synced to Google Drive and mobile via Smart Merge.
Fields
Unique identifier for this deck. Auto-generated as a UUID v4 on creation.
Display name shown in the deck list UI.
ISO 8601 timestamp of when the deck was first created, e.g.
"2024-03-15T10:30:00.123456".ISO 8601 timestamp of the last modification. The Smart Merge sync algorithm uses this field to resolve conflicts — the deck with the newer
updated_at wins.Filesystem path to the image folder that was scanned to generate this deck’s cards. Empty string for manually created decks.
Optional free-form description of the deck’s subject matter.
Properties
card_count → int
Computed property. Returns the number of cards currently in cards. Equivalent to len(deck.cards).
Methods
to_dict() → dict
Serializes the deck and all nested cards to a JSON-serializable dictionary. Each card in cards is serialized via Flashcard.to_dict().
UUID string.
Display name.
ISO 8601 creation timestamp.
ISO 8601 last-modified timestamp.
Source image folder path (may be empty string).
Deck description (may be empty string).
Array of serialized Flashcard objects.
from_dict(data) → Deck
Deserializes a Deck from a dictionary. Also deserializes all nested card objects by calling Flashcard.from_dict() on each entry in cards. Missing fields fall back to defaults (a new UUID is generated for deck_id if absent; timestamps default to now).
JSON example
The
updated_at field is updated by the application whenever a card is added, edited, or removed. Always preserve its value when round-tripping JSON — overwriting it with an older timestamp will cause Smart Merge to discard newer changes on the next sync.See also
Flashcard
The individual card data model stored inside a deck.
QuizSession
Tracks quiz progress over a deck’s cards.