--- id: anki version: "26.8.1" license: AGPL-3.0-or-later license_treatment: agpl maintenance: active --- # anki — Python library for Anki, the spaced repetition flashcard program License: agpl · Maintenance: active · Downloads: 276.3K/mo ## What it is and what it does Anki is a Python library that exposes the core scheduling and database engine behind Anki, the popular spaced-repetition flashcard application. It wraps a Rust backend (rslib) and provides a programmatic interface to collections, notes, cards, decks, scheduling algorithms (FSRS/SM-2), media management, import/export, and synchronisation with AnkiWeb. The library is primarily used by Anki add-on developers and anyone building automation or custom workflows around flashcard learning. The package depends on seven runtime libraries: decorator, distro, markdown, orjson, protobuf, requests, and typing-extensions. It requires Python 3.10 or later and ships as platform-specific compiled wheels (macOS ARM64/x86-64, Linux aarch64/x86-64, Windows amd64/ARM64). Installation has medium friction due to these compiled dependencies, but the project is actively maintained with a large, engaged community. Use it for: - Build Anki add-ons that extend the desktop application with custom scheduling, UI, or data-processing features. - Automate flashcard generation and bulk import from external data sources into Anki collections. - Create custom spaced-repetition learning applications that leverage Anki's scheduling algorithms. - Programmatically query and analyse learning statistics from existing Anki collections. - Synchronise flashcard data between Anki and external learning platforms or databases. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides Python access to Anki's core spaced-repetition engine, wrapping the Rust backend to let you programmatically open, query, and modify flashcard collections, schedules, and media. Yes, if you are building Anki add-ons, automating flashcard workflows, or need programmatic access to spaced-repetition scheduling. The library is actively maintained, well-established (29756 stars), and has no known vulnerabilities. The AGPL-3.0-or-later license requires that derivative works be open-source; verify this aligns with your project before use. Medium install friction (compiled wheels, Python 3.10+ required) is a minor trade-off for core functionality. ## Install pip install anki uv add anki poetry add anki ## Installing anki Before you install: Medium install friction due to compiled wheels (abi3, platform-specific); active maintenance with recent release (9 days old) and strong repository signals (29756 stars, last commit 2026-08-14). Requires Python 3.10+. License in practice: AGPL-3.0-or-later: derivative works and modifications must be released under AGPL. Suitable for open-source projects and add-ons; proprietary applications using this library must comply with copyleft obligations or seek alternative licensing. Quickstart: pip install anki from anki import Collection col = Collection('/path/to/collection.anki2') notes = col.find_notes('deck:Default') print(len(notes)) Requires Python 3.10 or later; platform-specific compiled wheels (macOS, Linux, Windows); Anki collection file path must exist and be readable. Verify before relying: - Whether the Rust backend is bundled in the wheel or requires separate installation. - Performance characteristics when working with large collections (thousands of cards). - Stability guarantees for the Python API across minor version updates. ## Package facts - License: AGPL-3.0-or-later (agpl) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 276.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags anki flashcard api, spaced repetition python, anki collection library, flashcard scheduling algorithm, anki add-on development, anki database access, memory learning automation, spaced-repetition, flashcard-engine, add-on-development [View on SkillFed](https://skillfed.io/packages/anki) · [View on PyPI](https://pypi.org/project/anki/)