genanki
Generate Anki decks programmatically
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.6 or later; generated .apkg files must be imported into Anki via File → Import.
- 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 · maintenance · safety
MIT (permissive) — MIT license is permissive, allowing free use, modification, and distribution with minimal restrictions—suitable for both personal and commercial projects.
last release 2023-11-12 (1006 days) · last repo commit 2024-12-30 · 2,672 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 248,427 downloads/mo, #8,665 on PyPI
Alternatives
Verify before relying
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')- Whether dormant status affects long-term compatibility with current Anki versions
- Performance characteristics when generating decks with thousands of notes
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 on this page. Verify before relying on it.
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
genanki on PyPI
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.
Requires Python 3.6 or later; generated .apkg files must be imported into Anki via File → Import.
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')
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 the current Python release >=3.6 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 4 packagescached-propertyfrozendictchevronpyyaml |
| Maintenance | Dormant 1,006 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 248,427 / month, #8,665 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: genanki-0.13.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “anki deck generation python”
- genankiGenerates Anki flashcard decks programmatically in Python, allowing…
- aqtaqt is the Qt-based desktop GUI for Anki, the spaced repetition…
- ankiProvides Python access to Anki's core spaced-repetition engine,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Utilities packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Pygments is a syntax highlighter that colorizes source code and text in over 500 languages and formats, outputting to HTML, LaTeX, RTF, SVG, images, or ANSI terminal sequences.
Install it if you need to display or transform source code.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
See also anki · aqt · fsrs · adaptive-cards-templating-py · essential-generators · PyLaTeX · pyscard · sphinx_design · pictex · microsoft-teams-cards