Ankitu is a tool to import and export Anki decks. It is written in Rust and uses the AnkiConnect API.
It can be used to import / export decks from / to Anki:
Format | Import | Export | Notes |
---|---|---|---|
TOML | ✔️ | ✔️ | Recommended for git versioning. See schema below. |
JSON | ✔️ | ✔️ | NOT recommended for git versioning. |
YAML | ✔️ | ✔️ | I don't really like using YAML for this purpose, but it is supported. |
Note: Ankitu is still in development and not all features are implemented yet.
TOML exports are designed to be stable and versionable for long-term use and git tracking.
- Each export includes a
version
field at the top level. - Notes, fields, and tags are sorted deterministically for reproducible output.
- The schema is documented below. If the schema changes, the version will be incremented and migration tools will be provided.
# ankituls export schema version = 1
version = 1
deck_name = "My Deck"
[[notes]]
noteId = 123456789
modelName = "Basic"
tags = ["tag1", "tag2"]
[notes.fields]
Front = { value = "Front content", order = 0 }
Back = { value = "Back content", order = 1 }
version
(int): Schema version of the export file.deck_name
(string): Name of the deck.notes
(array): List of notes.
noteId
(int): Unique note identifier.modelName
(string): Name of the note model.tags
(array of string): Tags for the note (sorted).fields
(table): Field name to value mapping (sorted by field name).
cargo install --git https://github.com/VaiTon/ankitu.git
Export/import a deck:
ankitu export <DECK> # print TOML export of deck to stdout
ankitu import <FOLDER> # import deck from TOML