Generate Anki flashcards
from your data.

Anki Forge is an open-source Anki APKG generation library with a Rust core and Rust, Python and Node.js interfaces. Package media, use custom templates and review updates before distribution.

Four card types. One Anki deck.

Choose your programming language.

Export spanish.apkg with Anki Forge 0.3.1. You do not need to install Anki to export a deck.

Python

CPython 3.11+
python -m pip install ankiforge==0.3.1
Build with Python

Use Anki Forge with AI.

Choose a programming language, describe your task, then paste the prompt into your AI coding assistant.

Rust

AI brief · Anki Forge 0.3.1
You are helping me use Anki Forge 0.3.1 in a Rust application.
Runtime requirement: Rust 1.92+

Use the published `ankiforge` package and only the public API documented for
this version. Do not use git/path dependencies, internal tools, source-only
APIs, unreleased methods, or invented methods.

My goal:
<describe your task>

Please:
1. Inspect the existing project before changing files.
2. Give the exact setup and installation command: cargo add ankiforge@0.3.1
3. Create the smallest complete runnable program and name every file to add or edit.
4. Produce a persistent `.apkg` file and use stable namespace and note keys.
5. Include the run command, expected output, and a verification step.
6. If media, custom templates, Image Occlusion, or updates are needed, use the
   documented workflow instead of approximating the API. For updates, keep the
   previous original distribution APKG as the baseline; do not use an Anki re-export.
7. Ask only the questions required to resolve an unknown language, input shape,
   output path, or identity rule.

Quickstart reference: https://ankiforge.dev/docs/quickstart/
Rust 1.92+
cargo add ankiforge@0.3.1

Node / TypeScript

AI brief · Anki Forge 0.3.1
You are helping me use Anki Forge 0.3.1 in a Node / TypeScript application.
Runtime requirement: Node.js 22.13+

Use the published `ankiforge` package and only the public API documented for
this version. Do not use git/path dependencies, internal tools, source-only
APIs, unreleased methods, or invented methods.

My goal:
<describe your task>

Please:
1. Inspect the existing project before changing files.
2. Give the exact setup and installation command: npm install --include=optional ankiforge@0.3.1
3. Create the smallest complete runnable program and name every file to add or edit.
4. Produce a persistent `.apkg` file and use stable namespace and note keys.
5. Include the run command, expected output, and a verification step.
6. If media, custom templates, Image Occlusion, or updates are needed, use the
   documented workflow instead of approximating the API. For updates, keep the
   previous original distribution APKG as the baseline; do not use an Anki re-export.
7. Ask only the questions required to resolve an unknown language, input shape,
   output path, or identity rule.

Quickstart reference: https://ankiforge.dev/docs/node-quickstart/
Node.js 22.13+
npm install --include=optional ankiforge@0.3.1

Python

AI brief · Anki Forge 0.3.1
You are helping me use Anki Forge 0.3.1 in a Python application.
Runtime requirement: CPython 3.11+

Use the published `ankiforge` package and only the public API documented for
this version. Do not use git/path dependencies, internal tools, source-only
APIs, unreleased methods, or invented methods.

My goal:
<describe your task>

Please:
1. Inspect the existing project before changing files.
2. Give the exact setup and installation command: python -m pip install ankiforge==0.3.1
3. Create the smallest complete runnable program and name every file to add or edit.
4. Produce a persistent `.apkg` file and use stable namespace and note keys.
5. Include the run command, expected output, and a verification step.
6. If media, custom templates, Image Occlusion, or updates are needed, use the
   documented workflow instead of approximating the API. For updates, keep the
   previous original distribution APKG as the baseline; do not use an Anki re-export.
7. Ask only the questions required to resolve an unknown language, input shape,
   output path, or identity rule.

Quickstart reference: https://ankiforge.dev/docs/python-quickstart/
CPython 3.11+
python -m pip install ankiforge==0.3.1

Export performance

Rust Project API / genanki 0.13.1 · 1,000 Basic notes per workload

52.7 msExport 1,000 text-only notes
45.7–53.9%Less export time across five measured workloads

Rust Project API · Apple M1 Pro · 10-run medians

Text, images, audio.
Faster in all five tests.

Each test uses 1,000 Basic notes. The five tests cover text-only notes, separate media files and shared media. In these tests, the Anki Forge Rust API took 45.7–53.9% less time to export than genanki.

Anki Forge Rustgenanki
Text only49.8% less time

52.7 ms / 105.0 ms

Unique images52.9% less time

150.7 ms / 320.2 ms

Unique audio53.3% less time

128.7 ms / 275.4 ms

Mixed, unique media53.9% less time

110.5 ms / 239.5 ms

Mixed, shared media45.7% less time

61.4 ms / 112.9 ms

These results measure deck generation, not Anki import or review speed; other hardware and workloads may differ. Method and original measurements

See the code. Try the card.

Switch between runnable Rust examples, flip the previews, and download the decks they produce.

Rust source → browser preview
let (front, back) = ("hola", "hello");
let mut project = Project::new("spanish")?.default_deck("Spanish");
project.add("es:hola", Note::basic(front, back))?;
let built = project.build(BuildOptions::to(output.join("spanish.apkg")))?;

Spanish
Spanish → English

hola

What does this mean?

Question shown.

Browser previews of exported content; import the APKG to check it in Anki.

Let your notes evolve.
Keep the same note IDs.

Correct a definition or add an example. Keep stable note IDs and use the original APKG from the previous release so Anki Forge can match existing notes when you export again.

Understand deck updates
Stable note IDes:hola
Front

hola

Back

hello

Try a content change.

Comparison results: RISK.NOTE_CHANGED (low). Publication policy: allows this change.

Download v1Download v2Comparison report

Keep the original distribution APKG. Import settings and newer local edits affect updates. Update guide

Catch problems before export.

Inspect diagnostics for missing fields, media, and template problems. Make validation part of your build.

Explore validation

Your cards. Your templates.

Start with Basic and Cloze, or define your own note types. Keep HTML, CSS, and media in reusable template bundles.

Explore templates

From your first deck to the next update

Start with a CSV spreadsheet, JSON data or cards drafted with an AI assistant. Follow a complete export recipe, then add media and review updates.