--- id: genanki version: "0.13.1" license: MIT license_treatment: permissive maintenance: dormant --- # genanki — Generate Anki decks programmatically License: permissive · Maintenance: dormant · Downloads: 248.4K/mo ## What it is and what it does genanki is a Python library that lets you build Anki flashcard decks programmatically instead of through the Anki GUI. You define note models (which specify fields and card templates), create individual notes with field values, add them to a deck, and export the result as an .apkg file that Anki can import. The library handles the underlying file format and structure, so you can focus on generating content—useful when you have data in code or a database that you want to turn into flashcards. The package supports media files (images and audio), custom GUIDs for updating existing notes, YAML-based template definitions, and can even write notes directly to a local Anki collection from within an Anki addon. Its four runtime dependencies (cached-property, frozendict, chevron, pyyaml) are all lightweight, keeping the installation footprint small. Use it for: - Generate flashcard decks from CSV or database records without manual Anki data entry - Create language-learning decks programmatically from vocabulary lists or APIs - Build study materials for technical subjects by scripting note generation from documentation - Update existing Anki decks by regenerating and re-importing with stable GUIDs - Integrate flashcard generation into an automated study-material pipeline ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Generates Anki flashcard decks programmatically in Python, allowing you to create notes, models, and packages that can be imported into Anki. Yes, if you need to generate Anki decks from code or data. The library is stable, has low install friction, carries no known vulnerabilities, and is permissively licensed. Dormant maintenance is not a blocker for a mature, single-purpose tool—but verify compatibility with your Anki version before relying on it for production workflows. ## Install pip install genanki uv add genanki poetry add genanki ## Installing genanki Before you install: Low install friction with four lightweight runtime dependencies. Dormant maintenance status (last release 2023-11-12, last commit 2024-12-30) means no active development, but the package is stable and archived repository is not flagged as abandoned. License in practice: MIT license is permissive, allowing free use, modification, and distribution with minimal restrictions—suitable for both personal and commercial projects. Quickstart: pip install genanki import genanki my_model = genanki.Model( 1607392319, 'Simple Model', fields=[{'name': 'Question'}, {'name': 'Answer'}], templates=[{'name': 'Card 1', 'qfmt': '{{Question}}', 'afmt': '{{Answer}}'}]) my_note = genanki.Note(model=my_model, fields=['Q', 'A']) my_deck = genanki.Deck(2059400110, 'My Deck') my_deck.add_note(my_note) genanki.Package(my_deck).write_to_file('output.apkg') Requires Python 3.6 or later; generated .apkg files must be imported into Anki via File → Import. Verify before relying: - Whether dormant status affects long-term compatibility with current Anki versions - Performance characteristics when generating decks with thousands of notes ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 248.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags anki deck generation python, programmatic flashcard creation, anki package builder, spaced repetition deck generator, anki importer library, flashcards, study-tools, data-generation [View on SkillFed](https://skillfed.io/packages/genanki) · [View on PyPI](https://pypi.org/project/genanki/)