May 7, 2026
Glossary Flashcards: An image to Anki deck generator
An older web app that turns book glossary photos into flashcards for Anki. Remastered with Claude's vision API.
Launch Live Demo (bring your own Anthropic API key)
The friction of typing flashcards by hand is what makes people stop using flashcards. That means they also lose the benefits of spaced repetition. I built this tool to remove that friction. You upload photos of a book’s glossary and get back a CSV that imports cleanly into an existing Anki deck.
The code is on GitHub and a live version is available on Hugging Face Spaces.
Implementation
The earlier version of the web app ran locally with Tesseract. It was free. It ran on a laptop. It needed no API keys. At that time books were more likely to include dedicated glossary sections. Today they often do not. Much of the useful vocabulary now appears not in a glossary but inline in bold. Consider a sentence such as “Classification is a problem of assigning a label to an unlabeled example.” Only one of the three bold words is actually being defined. The others are cross references. Pattern matching was no longer sufficient. The current pipeline is straightforward. An Express backend receives the uploaded photo. It sends the photo to Claude’s vision API. It parses the JSON response. It renders an editable table. Finally it exports a CSV. The whole stack takes about 300 lines of code.
Engineering Challenges
Most of the engineering was not in the JavaScript. It was in three other places.
The prompt did more work than the code did. Telling the model explicitly to skip bold words that are merely referenced fixed almost every false positive in a single edit. Iterating on the wording of that prompt was the highest leverage work in the entire build.
The browser misreported file types. An uploaded WebP file arrived labeled as image/jpeg. Claude’s API correctly rejected the mismatch. The fix was to detect the true format from the first few bytes of the file (its “magic numbers”) and to ignore what the upload claimed.
Anki has its own CSV grammar. The first export produced cards with every term and definition on the front and a blank back. A plain CSV tells Anki nothing about how to map columns to fields or which deck to create. The fix was learning that Anki reads #header:value lines at the top of a CSV file. Adding five such lines turned the import into a single click.
These problems are worth noting. Each lived in the gap between the documentation and what the system actually did when I ran it.
Deployment and Hosting
The app is now live on Hugging Face Spaces. Hosting it publicly was not possible before. Every extraction is a paid API call and I preferred not to share my own API key. Sharing it would let any visitor run up my personal cost. Preventing that seemed out of scope until I realized the app could ask each user to supply their own API key.
In short: paste your own Anthropic key into the app. It is used for that single request and never stored. Everyone pays only for their own usage. There is no shared bill. The source is on GitHub and the video above shows it in action.