Skip to main content

anki-voiced

Generate Anki flashcard decks with AI-voiced audio.

Quick Start

pip install anki-voiced       # Install the tool
anki-voiced init              # Create sample vocabulary.csv and deck.toml
anki-voiced create vocabulary.csv  # Generate deck with AI audio

Installation

# Using uv (recommended)
uv tool install anki-voiced

# Using pip
pip install anki-voiced

# Using pipx
pipx install anki-voiced

To uninstall:

uv tool uninstall anki-voiced
# or
pip uninstall anki-voiced

System Requirements

  • Python 3.10+
  • espeak-ng for phonemization:
    # Ubuntu/Debian
    sudo apt install espeak-ng
    
    # macOS
    brew install espeak-ng
    

Japanese Language Support

For Japanese TTS, download the UniDic dictionary after installation:

python -m unidic download

This downloads ~500MB of dictionary data required for Japanese text processing.

Usage

Create a deck from CSV

# Quick single deck
anki-voiced create sentences.csv -o my-deck.apkg --lang japanese --voice male

# With config file for multi-tier decks
anki-voiced create --config deck.toml

# Read from stdin
cat data.csv | anki-voiced create - -o deck.apkg

Initialize a new project

anki-voiced init --lang japanese

Creates:

  • vocabulary.csv - Sample vocabulary file
  • deck.toml - Configuration file for multi-tier decks

List available voices

anki-voiced voices
anki-voiced voices --lang japanese

Combine multiple decks

anki-voiced join tier1.apkg tier2.apkg -o combined.apkg -n "Master Deck"

Commands

create

Generate an Anki deck with AI-voiced audio from a CSV file.

Usage: anki-voiced create [OPTIONS] DATA_FILE

Options:
  -o, --output PATH       Output .apkg file [default: DATA_FILE.apkg]
  -n, --name TEXT         Deck name shown in Anki [default: filename]
  -l, --lang LANG         Language: english, japanese, french, portuguese
  -v, --voice VOICE       Voice: male, female, or specific voice name
  -t, --template NAME     Card template: basic, double-card, cloze
  -c, --config FILE       TOML config (overrides other options)
      --dry-run           Show what would be generated
      --force             Regenerate audio even if cached
  -q, --quiet             Minimal output (for scripts)
      --json              Machine-readable JSON output

init

Create a new deck project with sample files.

Usage: anki-voiced init [OPTIONS]

Options:
  -l, --lang LANG    Language for sample content [default: english]
  -t, --template     Template to use [default: double-card]

voices

List available voices for text-to-speech.

Usage: anki-voiced voices [OPTIONS]

Options:
  -l, --lang LANG    Filter by language
      --json         Machine-readable JSON output

join

Combine multiple .apkg files into one master deck.

Usage: anki-voiced join [OPTIONS] DECK_FILES...

Options:
  -o, --output PATH    Output .apkg file (required)
  -n, --name TEXT      Master deck name (required)

Templates

basic - Simple Front/Back

  • Fields: front, back
  • Cards: 1 card (Front + Audio -> Back)
  • Use case: Simple vocabulary, phrases
front,back
Hello,Bonjour
Goodbye,Au revoir

double-card - Comprehension + Production

  • Fields: sentence, translation, pronunciation, tags
  • Cards: 2 cards per entry
    • Comprehension: Audio + Sentence -> Translation
    • Production: Translation + Hint -> Sentence + Audio
  • Use case: Language learning with active recall
sentence,translation,pronunciation,tags
The meeting starts at 10 AM.,La réunion commence à 10h.,The meeting starts at 10 AM.,business

cloze - Fill-in-the-blank

  • Fields: text (with {{c1::cloze}}), extra
  • Cards: Auto-generated from cloze markers
  • Use case: Grammar patterns, vocabulary in context
text,extra
I {{c1::like}} apples.,verb: to enjoy
She {{c1::runs}} every day.,verb: to run

Languages & Voices

Language Code Default Voice Available Voices
English en af_heart af_heart, af_bella, af_nicole, af_sarah, af_sky, am_adam, am_michael
Japanese ja jm_kumo jf_alpha, jf_gongitsune, jf_nezumi, jf_tebukuro, jm_kumo
French fr ff_siwis ff_siwis
Portuguese pt pf_camila pf_camila

Configuration

Project Config (deck.toml)

name = "Japanese IT Vocabulary"
language = "japanese"
voice = "jm_kumo"
template = "double-card"
output = "japanese-it-complete.apkg"

[[tiers]]
name = "Tier 1 - Foundations"
data = "tier1.csv"

[[tiers]]
name = "Tier 2 - Development"
data = "tier2.csv"

Environment Variables

ANKI_VOICED_LANG=japanese      # Default language
ANKI_VOICED_VOICE=female       # Default voice
ANKI_VOICED_TEMPLATE=basic     # Default template
NO_COLOR=1                     # Disable colors

Configuration Precedence

  1. Command-line flags (highest)
  2. Environment variables
  3. Project config (deck.toml in current directory)
  4. User config (~/.config/anki-voiced/config.toml)
  5. Built-in defaults (lowest)

Caching

Audio files are cached in ~/.cache/anki-voiced/ for faster regeneration. To clear the cache:

rm -rf ~/.cache/anki-voiced

Development

# Clone the repo
git clone https://github.com/kakkoidev/anki-voiced
cd anki-voiced

# Install with uv (recommended)
uv sync --all-extras

# Run tests
uv run pytest

# Run locally
uv run anki-voiced --help

# Or with pip
pip install -e ".[dev]"
pytest
python -m anki_voiced --help

License

MIT

Credits

Metadata

Release files for anki-voiced 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for anki-voiced 0.1.0
File Size Uploaded
anki_voiced-0.1.0.tar.gz 209.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for anki-voiced 0.1.0
File Interpreter ABI Platform
anki_voiced-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 239.4 kB

Release files / anki_voiced-0.1.0.tar.gz

Download URL anki_voiced-0.1.0.tar.gz
Size 209.4 kB
Tags Source
SHA-256 checksum
How to use checksums
69ed53a66d22a52043e607f20f4d3d9146397862dbfdf9da9af1308de9499b58
BLAKE2b-256 checksum
How to use checksums
d5eb6adc2868ad9fe1fd818c9eb354097cdafa8fd8abf41c4449cf7f3e9cd3c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"25.04","id":"plucky","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / anki_voiced-0.1.0-py3-none-any.whl

Download URL anki_voiced-0.1.0-py3-none-any.whl
Size 30.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
da7b21094752fac6df9e72d027069c4b560dbedced96557f89561d9ef174b3b9
BLAKE2b-256 checksum
How to use checksums
6f70bef4278b25960c1551a03ce4a4cb5e912d98b8dda4e491b66b70b938f164
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"25.04","id":"plucky","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page