Metadata-Version: 2.5
Name: ankinote-ai
Version: 1.4.1
Summary: AI-powered Anki card generator for vocabulary, phrases, sentences, and STEM concepts, powered by litellm
Project-URL: Homepage, https://github.com/ankinote-ai/ankinote
Project-URL: Repository, https://github.com/ankinote-ai/ankinote
Project-URL: Documentation, https://github.com/ankinote-ai/ankinote
Author-email: Chris Chen <chrischen@ignity.xyz>
License: MIT
License-File: LICENSE
Keywords: ai,anki,flashcards,google-ai,language-learning,vocabulary
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Education
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Education
Requires-Python: >=3.14
Requires-Dist: anki==26.8.1
Requires-Dist: asynciolimiter>=1.2.0
Requires-Dist: click>=8.2.0
Requires-Dist: fastapi>=0.141.1
Requires-Dist: google-cloud-texttospeech>=2.31.0
Requires-Dist: httpx>=0.28.0
Requires-Dist: lameenc>=1.9.0
Requires-Dist: litellm>=1.108.4
Requires-Dist: loguru>=0.7.3
Requires-Dist: markdown-it-py>=4.0.0
Requires-Dist: pillow>=12.1.0
Requires-Dist: pydantic>=2.12.5
Requires-Dist: python-dotenv>=1.1.1
Requires-Dist: questionary>=2.0
Requires-Dist: rich>=14.1.0
Requires-Dist: shortuuid>=1.0.13
Requires-Dist: uvicorn>=0.52.3
Provides-Extra: headless
Requires-Dist: anki==26.8.1; extra == 'headless'
Description-Content-Type: text/markdown

# AnkiNote

<p align="center">
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/ankinote-ai/ankinote/main/docs/brand/mark-dark.svg">
    <img src="https://raw.githubusercontent.com/ankinote-ai/ankinote/main/docs/brand/mark-light.svg" width="96" alt="AnkiNote logo">
  </picture>
</p>

<p align="center">
  <strong>Turn any word, sentence, or STEM problem into a ready-to-review Anki card in seconds.</strong>
</p>

<p align="center">
  <a href="https://pypi.org/project/ankinote-ai/"><img src="https://img.shields.io/pypi/v/ankinote-ai?color=blue&logo=pypi&logoColor=white" alt="PyPI version"></a>
  <a href="https://pypi.org/project/ankinote-ai/"><img src="https://img.shields.io/pypi/pyversions/ankinote-ai?color=blue&logo=python&logoColor=white" alt="Python versions"></a>
  <a href="https://github.com/ankinote-ai/ankinote/blob/main/LICENSE"><img src="https://img.shields.io/pypi/l/ankinote-ai?color=blue" alt="License"></a>
  <a href="https://codecov.io/gh/ankinote-ai/ankinote"><img src="https://img.shields.io/codecov/c/github/ankinote-ai/ankinote?logo=codecov&logoColor=white" alt="Codecov"></a>
</p>

<p align="center">
  <strong>English</strong> | <a href="README.zh-CN.md">简体中文</a> | <a href="README.zh-Hant.md">繁體中文</a> | <a href="README.ja.md">日本語</a> | <a href="README.es.md">Español</a> | <a href="README.fr.md">Français</a>
</p>

---

<p align="center">
  <img src="https://raw.githubusercontent.com/ankinote-ai/ankinote/main/docs/img/demo-hero.gif" width="860" alt="AnkiNote demo: type a word, generate the card, flip to the back">
</p>

**Make every flashcard worth your time.** Making one takes seconds, and each card earns the reviews it costs. **AnkiNote** is a bring-your-own-key AI card studio that turns a word, phrase, sentence, or STEM problem into a complete, styled Anki card — with explanations, natural examples, memory hooks, illustrations, and audio — and saves it straight to your Anki.

No manual formatting. No copy-pasting between ChatGPT and Anki. Paste one API key, run it locally or on a home server, and review on your phone, tablet, or desktop.

---

## ✨ What You Get

<table>
  <tr>
    <td width="50%" valign="top" align="center"><img src="https://raw.githubusercontent.com/ankinote-ai/ankinote/main/docs/img/showcase-word.png" alt="Language card: definition, illustration, examples"><br><sub>Language card: definition, illustration, examples</sub></td>
    <td width="50%" valign="top" align="center"><img src="https://raw.githubusercontent.com/ankinote-ai/ankinote/main/docs/img/showcase-stem.png" alt="STEM card: formulas and a step-by-step solution"><br><sub>STEM card: formulas and a step-by-step solution</sub></td>
  </tr>
</table>

<table>
  <tr>
    <td width="33%" valign="top" align="center"><img src="https://raw.githubusercontent.com/ankinote-ai/ankinote/main/docs/img/device-word-night.png" width="260" alt="Word card in AnkiMobile"><br><sub>Word card in AnkiMobile</sub></td>
    <td width="33%" valign="top" align="center"><img src="https://raw.githubusercontent.com/ankinote-ai/ankinote/main/docs/img/phone-text.png" width="260" alt="From text on a phone"><br><sub>From text on a phone</sub></td>
    <td width="33%" valign="top" align="center"><img src="https://raw.githubusercontent.com/ankinote-ai/ankinote/main/docs/img/device-stem.png" width="260" alt="STEM card in AnkiMobile"><br><sub>STEM card in AnkiMobile</sub></td>
  </tr>
</table>

- **Four card modes, one thing per card** — Word, Phrase, Sentence, and STEM cards built to stay short, accurate, and spoiler-free. Irregular forms like *went* even get their own card (*go – went – gone*).
- **Written for your native language** — Confusions and notes target the mistakes speakers of your language actually make (for example, warning Japanese speakers that *claim* doesn't mean クレーム).
- **Checked on real cards, not just prompted** — Every card type is tested on real output from Gemini, OpenAI, DeepSeek, and Claude (down to each provider's cheapest model), and language pairs ship only after passing review.
- **Live preview, inline editing & dark-mode themes** — Flip front/back and Light/Dark before saving, edit any field inline, or fix broken LaTeX in one click. Choose from **Rosé Pine**, **Kanagawa**, **Tokyo Night**, and **Gruvbox** — cards follow Anki's night mode automatically across desktop, AnkiDroid, and AnkiMobile.
- **Works with your existing Anki** — Writes straight to Anki Desktop via AnkiConnect with no duplicate collection, or runs built-in Anki with AnkiWeb sync on a home server/NAS.

<details>
<summary>Preview all 4 card themes (Light &amp; Dark)</summary>

<p align="center">
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/ankinote-ai/ankinote/main/docs/img/themes-dark.png">
    <img src="https://raw.githubusercontent.com/ankinote-ai/ankinote/main/docs/img/themes-light.png" width="860" alt="Four card palettes: Kanagawa, Tokyo Night, Gruvbox and Rosé Pine, in light and dark">
  </picture>
</p>
</details>

---

## 💡 Core Workflows

### Pick words right out of what you're reading

Switch **Generate** to **From text** and paste a sentence or paragraph. Tap the words and phrases you don't know, and **Sort** turns your marks into a clean list in dictionary form with glosses in your language.

<p align="center">
  <img src="https://raw.githubusercontent.com/ankinote-ai/ankinote/main/docs/img/from-text.png" width="860" alt="From text: words marked in a pasted paragraph, and the list Sort made from them">
</p>

- **Catches the whole phrase** — Tap *track* in *"I lost track of time"* and AnkiNote extracts *"lose track of"*.
- **Cards in context** — Each card is generated with its source sentence, so it covers only the sense used there.
- **Review sentence by sentence** — Uncheck, edit, switch between word and phrase, or add a sentence card before generating.

### Turn a missed STEM problem into a card

Snap a photo of a homework or exam problem, switch **Generate** to **STEM**, and drop or paste the image:

- **Self-contained front, step-by-step back** — Rewrites the problem cleanly with MathJax formulas and highlights the clue that leads to the solution method, not just the algebra.
- **Ask a tutor-style follow-up** — Save the card, type something like *"How would I come up with this myself?"*, and click **Rewrite** to create a companion card on deriving the strategy (**Save again** keeps both; **Undo** restores the first).
- **Edit or repair before saving** — Tweak any field inline or fix broken formulas in one click with **Fix with AI**.

<p align="center">
  <img src="https://raw.githubusercontent.com/ankinote-ai/ankinote/main/docs/img/stem-follow-up.png" width="860" alt="A solution card, the follow-up typed in the rewrite box, and the new card on deriving the method"><br>
  <sub>One follow-up question turns a solution card into a card on how to derive the method</sub>
</p>

<details>
<summary>See AI-generated STEM diagrams across subjects</summary>

<p align="center">
  <img src="https://raw.githubusercontent.com/ankinote-ai/ankinote/main/docs/img/stem-diagrams.png" width="860" alt="Six STEM diagrams: a projectile, a right triangle's altitude, a convex function's chord, the 68-95-99.7 rule, a binary search tree, and simple vs compound interest"><br>
  <sub>Diagrams drawn directly from each card's own values across physics, geometry, calculus, statistics, data structures, and finance (labels follow the card's language)</sub>
</p>
</details>

---

## 🚀 Quick Start

The only prerequisite is [uv](https://docs.astral.sh/uv/getting-started/installation/) (it manages Python for you):

```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
```

Run AnkiNote directly without installing (always launches the latest release):

```bash
uvx --from ankinote-ai@latest ankinote-web
```

Open **<http://127.0.0.1:8000>** in your browser. On first launch, the **Setup Wizard** guides you through:

1. **AI Provider** — Paste a single Gemini API key (covers text, images, and speech), or expand **Advanced** for OpenAI, Claude, DeepSeek, fal.ai, or custom endpoints.
2. **Anki Connection** — Open Anki Desktop with the [AnkiConnect](https://ankiweb.net/shared/info/2055492159) add-on installed; the wizard connects automatically. *(On a server without Anki Desktop, choose **Built-in Anki** and sign in to AnkiWeb.)*
3. **Languages, Theme & First Card** — Pick your languages and color palette, then generate and save your first card inside the wizard.

To install globally as a command:

```bash
uv tool install ankinote-ai
ankinote-web
```

> [!TIP]
> **Using Anki FSRS?** Follow the 1-minute [Anki Deck & FSRS Setup Guide](docs/anki-setup.md) to enable sibling burying and gather order across all AnkiNote subdecks.

---

## 🐳 Self-Hosting with Docker

Run AnkiNote 24/7 on a home server or NAS to create cards from your phone's browser anytime, even when your computer is off. *(On the computer where you use Anki Desktop, Quick Start above is all you need.)* Multi-arch images (`amd64` + `arm64`) are published to `ghcr.io/ankinote-ai/ankinote` and `ignity21/ankinote-ai`.

```bash
# Built-in Anki + AnkiWeb sync (no desktop app required)
cd deploy/headless
cp .env.example .env      # optional: AnkiWeb credentials, port, etc.
docker compose up -d      # open http://localhost:8080
```

> [!IMPORTANT]
> AnkiNote has no built-in login — keep it on your home network, Tailscale, or behind an authenticating reverse proxy. See the [Docker Deployment Guide](deploy/README.md) for custom hostnames (`ANKINOTE_ALLOWED_HOSTS`), reverse-proxy setup, and `deploy/standard` (AnkiConnect).

---

## ⌨️ CLI & AI Agents

The `ankinote` CLI creates cards from the terminal using the same settings as the web app, so any AI agent that can run shell commands (Claude Code, Codex, etc.) can make cards for you.

```bash
# Turn underlined words from a book photo (via your agent) into cards
ankinote word batch serendipity ephemeral eloquent

# Batch-generate from a word list (one item per line)
ankinote word batch --file words.txt --rpm 30
```

- Run bare `ankinote` for an interactive settings menu.
- Run `ankinote skill install` once (and again after upgrades) to teach your AI agent these commands.
- See the [CLI Usage Guide](docs/cli-usage.md) for phrases, sentences, STEM, and context JSONL. *(CLI cards save straight to Anki; paste lists into the web app to preview first.)*

---

## 🤖 Supported Providers

| Capability | Built-in Presets & Compatibility |
| --- | --- |
| **Text Generation** | Gemini, OpenAI, Claude, DeepSeek, or any OpenAI-compatible endpoint (via `litellm`) |
| **Image Generation** | Gemini, OpenAI (`gpt-image`), fal.ai |
| **Text-to-Speech** | Gemini TTS, OpenAI TTS, Google Cloud TTS |

All API keys and settings stay locally in `~/.config/ankinote/settings.json`. For supported language pairs, TTS accents, Google Cloud TTS setup, system requirements, and environment variables, see [Configuration, Providers & Languages](docs/configuration.md).

---

## 📚 Documentation

- [Anki Deck & FSRS Setup](docs/anki-setup.md) — recommended deck presets, sibling burying, and daily limits
- [Configuration, Providers & Languages](docs/configuration.md) — supported languages, TTS details, system requirements, and environment variables
- [Docker Deployment Guide](deploy/README.md) — headless & standard stacks, Tailscale, reverse proxies, and migration
- [CLI Usage Guide](docs/cli-usage.md) — terminal commands, batch files, and STEM options
- [Note Types Reference](docs/NoteType.org) — card fields and template structure
- [Agent Skill](src/ankinote/skills/ankinote-cli/SKILL.md) — for using AnkiNote with AI coding assistants

---

## 🛠️ Development

```bash
git clone https://github.com/ankinote-ai/ankinote.git
cd ankinote

uv sync                   # install Python dependencies (Python 3.14+)
make web-dev              # Svelte + Vite frontend dev server
uv run ankinote-web       # FastAPI backend (ANKINOTE_API_DOCS=1 for /api/docs)

make test                 # pytest suite
make format && make check # ruff format/lint + ty type-check
```

## 🌐 Community & License

- [GitHub Discussions](https://github.com/ankinote-ai/ankinote/discussions) — questions, ideas, and cards you've made
- [LINUX DO](https://linux.do/)
- Licensed under the [MIT License](LICENSE)
