https://github.com/vaiton/ankituls
A tool to import and export Anki decks in common formats
https://github.com/vaiton/ankituls
anki toml
Last synced: 3 days ago
JSON representation
A tool to import and export Anki decks in common formats
- Host: GitHub
- URL: https://github.com/vaiton/ankituls
- Owner: VaiTon
- License: other
- Created: 2023-06-09T21:52:46.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-06-27T16:47:19.000Z (5 days ago)
- Last Synced: 2025-06-27T17:37:49.050Z (5 days ago)
- Topics: anki, toml
- Language: Go
- Homepage:
- Size: 123 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ankitu
Ankitu is a tool to import and export Anki decks.
It is written in Rust and uses the [AnkiConnect](https://github.com/FooSoft/anki-connect) 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 Export Schema & Versioning
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.### Example
```toml
# 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 }
```### Top-level fields
- `version` (int): Schema version of the export file.
- `deck_name` (string): Name of the deck.
- `notes` (array): List of notes.### Note fields
- `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).---
## Installation
```bash
cargo install --git https://github.com/VaiTon/ankitu.git
```## Usage
Export/import a deck:
```bash
ankitu export # print TOML export of deck to stdoutankitu import # import deck from TOML
```