Notes In, One Card Out

the flashcard loop

Part of: Flashcard Maker

You're going to build a tool that eats your messy class notes and hands back a clean deck of study flashcards, then exports them so they drop straight into Anki. By lesson 8 it's a real command-line tool. This lesson builds the smallest slice that works: notes in, one question/answer card out. The whole build in one sentence Take a block of notes, ask the model to pull the key facts out as question/answer pairs, clean up the result, and write it to a CSV file. That's the entire product. Every lesson from here adds exactly one piece: chunking long notes, getting clean JSON, removing duplicates, controlling cost, validating, and exporting. The card is the unit A flashcard is just two strings: a question and an answer . In Python that's a dict: A deck is a list of those dicts. Everything the tool does is turn text into a list of these dicts, then write that list to disk. Keep the shape in mind: str in, list[dict] out, a file at the end. The smallest thing that works Give the model one fact and ask for one card. The prompt carries the rules: The model replies with two lines. You parse them into a dict: Why force the reply into this shape We told the model to answer in a rigid Q:/A: lay

Challenge: Count Well-Formed Cards