anki_deck_from_text¶
Generate Anki flashcard decks (.apkg) from annotated text files.
Mark vocabulary lines in any text file, and anki_deck_from_text will turn them into a ready-to-import Anki deck.
Quick example¶
Given an input file vocab.txt:
Run:
This creates spanish_vocab.apkg with three cards, ready to import into Anki.
Features¶
- Simple annotation format -- mark lines with a character (default
-) and separate front/back with another (default=) - Automatic encoding detection -- handles UTF-8, Latin-1, and other encodings via chardet
- Multiple card types -- built-in
basicandsoundmodels, with support for custom models - Reverse cards -- swap front and back with
--reverse - Dry run / preview -- see what cards would be generated before writing the file
- Tags -- add comma-separated Anki tags to all cards
- Merge multiple files -- combine several input files into one deck with
-i
Next steps¶
- Installation -- install via pip, pipx, or from source
- Input Format -- learn the annotation rules
- CLI Usage -- explore all command-line options
- Examples -- end-to-end usage examples
- API Reference -- module and function documentation