AI-powered Anki deck generator: turn a CSV of word pairs into a multimedia .apkg with TTS and illustrations.
Project description
Anita — AI-Powered Anki Deck Generator
Turn a plain CSV of word pairs into a rich, multimedia Anki deck with AI-generated native-like pronunciations and optional illustrations — in minutes, for any language pair.
Why Anita?
Language learners lose hours building decent flashcards by hand. Anita automates the tedious
part — generating TTS audio (OpenAI or ElevenLabs) and optional DALL·E images — so you can
focus on reviewing, not curating. Feed it a CSV, get back a .apkg you can import straight
into Anki on desktop or mobile.
Table of contents
Features
- CSV in,
.apkgout — point it at a two-column CSV and get a ready-to-import Anki deck. - Pluggable TTS — OpenAI
tts-1by default, ElevenLabs multilingual v2 optional. - Optional illustrations — DALL·E 2 images auto-resized to 128×128 px for clean cards.
- Local media cache — every generated asset is cached in a SQLite DB so repeat runs are free and fast.
- Language-agnostic — works for any source → target language pair.
- Clean card template — distraction-free front/back with audio playback and image.
Quickstart
# Install
uv tool install anita-anki # or: pipx install anita-anki
# Set credentials
export OPENAI_API_KEY=sk-...
# Optional:
export ELEVENLABS_API_KEY=...
# Generate
anita generate examples/basics.csv my_deck.apkg --deck-name "My Vocabulary"
Import my_deck.apkg into Anki and start reviewing.
Installation
From PyPI (recommended)
uv tool install anita-anki
# or
pipx install anita-anki
# or
pip install anita-anki
The distribution is published as
anita-ankion PyPI (the nameanitawas taken), but the import name and CLI are bothanita.
From source (development)
git clone https://github.com/timpara/anita.git
cd anita
uv sync --all-extras
uv run anita --help
Usage
CLI
anita generate INPUT.csv OUTPUT.apkg [OPTIONS]
Common options:
| Flag | Default | Description |
|---|---|---|
--deck-name |
Anita Vocabulary |
Deck name shown inside Anki. |
--tts |
openai |
TTS provider: openai or elevenlabs. |
--images / --no-images |
--no-images |
Generate DALL·E illustrations per card. |
--voice-id |
(elevenlabs preset) | ElevenLabs voice ID. |
--verbose |
false |
Enable debug logging. |
Run anita generate --help for the full list.
Python API
from anita import AnkiDeckGenerator
generator = AnkiDeckGenerator(
deck_name="Italian Restaurant",
tts_provider="elevenlabs",
generate_images=True,
)
generator.generate_deck("examples/restaurant.csv", "restaurant.apkg")
CSV format
Two columns: source word (prompt side) and target word (answer side). Header row is optional and auto-detected.
apple,mela
house,casa
book,libro
water,acqua
Working examples live in examples/.
Configuration
API keys are read from environment variables. A .env file in the working directory is
auto-loaded if present.
| Variable | Required for |
|---|---|
OPENAI_API_KEY |
OpenAI TTS, DALL·E |
ELEVENLABS_API_KEY |
ElevenLabs TTS (optional) |
Generated media is cached under your OS user-cache directory (via
platformdirs) so re-running on the same words
incurs zero API cost.
Cost estimate
| Service | Use case | Model | Approximate cost |
|---|---|---|---|
| OpenAI | TTS | tts-1 |
$0.015 / 1k characters |
| OpenAI | Image generation | DALL·E 2 | $0.020 / image (256×256) |
| ElevenLabs | Premium TTS | v2 | Per your subscription tier |
A 500-word deck with audio-only (OpenAI) typically costs well under $0.50.
Contributing
Contributions welcome! See CONTRIBUTING.md for dev setup, coding style, and PR conventions. By participating you agree to the Code of Conduct.
To report a security issue, please see SECURITY.md.
License
Apache License 2.0 © 2024–present Anita contributors.
Acknowledgments
- genanki — Anki deck construction.
- OpenAI — TTS and image generation.
- ElevenLabs — premium multilingual voices.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file anita_anki-0.1.0.tar.gz.
File metadata
- Download URL: anita_anki-0.1.0.tar.gz
- Upload date:
- Size: 18.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50f48f79771adb1bff0f7c309a984b59bd71d98475f8d1c2c0d0f8b9bf058786
|
|
| MD5 |
0b9590610dbec8cf37dfc40d36cd6913
|
|
| BLAKE2b-256 |
e93e0c1039ebbdd2178bac8081c1e02f947a49e4579f66546f5f6c4e878910f9
|
Provenance
The following attestation bundles were made for anita_anki-0.1.0.tar.gz:
Publisher:
release.yml on timpara/anita
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
anita_anki-0.1.0.tar.gz -
Subject digest:
50f48f79771adb1bff0f7c309a984b59bd71d98475f8d1c2c0d0f8b9bf058786 - Sigstore transparency entry: 1348381619
- Sigstore integration time:
-
Permalink:
timpara/anita@df5c8f19896fab397f63dbf50c7ed35feadb2dab -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/timpara
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@df5c8f19896fab397f63dbf50c7ed35feadb2dab -
Trigger Event:
push
-
Statement type:
File details
Details for the file anita_anki-0.1.0-py3-none-any.whl.
File metadata
- Download URL: anita_anki-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ce7cdd70336fc1d2a5d8ccafc9a89956c739b37cae79e554b3fc6381179e7ed
|
|
| MD5 |
045a96769e9e0fa67b743193ce4bcd16
|
|
| BLAKE2b-256 |
9112ce9a4f6b911fc35e5be7edd12acf934925c1b218e298ca8d0db821f54ac8
|
Provenance
The following attestation bundles were made for anita_anki-0.1.0-py3-none-any.whl:
Publisher:
release.yml on timpara/anita
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
anita_anki-0.1.0-py3-none-any.whl -
Subject digest:
6ce7cdd70336fc1d2a5d8ccafc9a89956c739b37cae79e554b3fc6381179e7ed - Sigstore transparency entry: 1348381688
- Sigstore integration time:
-
Permalink:
timpara/anita@df5c8f19896fab397f63dbf50c7ed35feadb2dab -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/timpara
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@df5c8f19896fab397f63dbf50c7ed35feadb2dab -
Trigger Event:
push
-
Statement type: