Expand description
High-level workflow operations for Anki via AnkiConnect.
This crate provides ergonomic, high-level operations built on top of the
ankit client library. While ankit provides 1:1 API bindings, ankit-engine
combines multiple API calls into cohesive workflows.
§Quick Start
use ankit_engine::Engine;
let engine = Engine::new();
// High-level workflows
let stats = engine.analyze().study_summary("Japanese", 30).await?;
println!("Cards reviewed: {}", stats.total_reviews);
// Direct client access when needed
let version = engine.client().misc().version().await?;§Feature Flags
All workflow modules are enabled by default. Disable with:
[dependencies]
ankit-engine = { version = "0.1", default-features = false, features = ["analyze"] }Available features:
import- Bulk import with duplicate handlingexport- Deck and review history exportorganize- Deck cloning, merging, reorganizationanalyze- Study statistics and problem card detectionmigrate- Note type migration with field mappingmedia- Media audit and cleanupprogress- Card state management and performance taggingenrich- Find and update notes with empty fieldsdeduplicate- Duplicate detection and removalbackup- Deck backup and restore to .apkg filessearch- Content search helpers (always enabled)
Modules§
- analyze
- Study statistics and problem card detection.
- backup
- Backup and restore workflows for Anki decks.
- deduplicate
- Duplicate note detection and removal.
- enrich
- Note enrichment operations.
- export
- Deck and review history export operations.
- import
- Bulk import operations with duplicate handling.
- media
- Media audit and cleanup operations.
- migrate
- Note type migration operations.
- organize
- Deck organization operations.
- progress
- Progress management and card state operations.
- search
- Content search helpers for finding notes.
Structs§
- Anki
Client - The main client for interacting with AnkiConnect.
- CanAdd
Result - Result of checking if a note can be added.
- Card
Answer - Answer for a card review.
- Card
Info - Information about a card.
- Card
ModTime - Modification time information for a card.
- Card
Template - Card template for a model (used in responses from modelTemplates).
- Client
Builder - Builder for creating a customized
AnkiClient. - Create
Model Params - Parameters for creating a new model.
- Deck
Config - Configuration for a deck.
- Deck
Stats - Statistics for a deck.
- Engine
- High-level workflow engine for Anki operations.
- Field
Font - Font information for a field.
- Find
Replace Params - Parameters for find and replace in models.
- Lapse
Config - Configuration for lapses.
- Media
Attachment - A media attachment for a note (audio, video, or picture).
- Model
Field - Field information for a model.
- Model
Styling - Model styling information.
- NewCard
Config - Configuration for new cards.
- Note
- A new note to be added to Anki.
- Note
Builder - Builder for creating notes with a fluent API.
- Note
Field - A field value with metadata.
- Note
Info - Information about an existing note.
- Note
ModTime - Modification time information for a note.
- Note
Options - Options for adding notes.
- Review
Config - Configuration for reviews.
- Store
Media Params - Parameters for storing a media file.
Enums§
- Duplicate
Scope - Scope for duplicate note checking.
- Ease
- Answer ease for reviewing cards.
- Error
- Errors that can occur during engine operations.
Type Aliases§
- Result
- Result type for ankit-engine operations.