𝕾 Selected Notes to Structured Text (for LLMs)

AnkiWeb addon 1694585841

Exports selected Anki notes as LLM-friendly structured text—copyable or saved—preserving field contents unchanged while including note type, deck path, and optionally tags.
AI-generated summary; may contain mistakes.

export

Open on AnkiWeb GitHub Find alternatives

AnkiWeb

Votes
2 (👍 2 · 👎 0)
Updated
2026-08-24
Anki versions
26.09~
License
AGPL-3.0 (from the license file in the package)
Virus scan
No ClamAV match A match does not prove malware. No match does not prove that the code is safe.
Languages
Python, JSON
Description language
en

Maintenance

active

  • Last update or commit: 2026-08-31 (62 days before the snapshot).
  • Commits in the last year: 13.
  • Issues: 0 open, 0 closed.
  • Pull requests: 0 open, 0 merged.

Will it work on my Anki?

Version branches
Min AnkiMax AnkiUpdated
26.0126.09+2026-08-24
History across monthly snapshots

Loading…

Similar addons

𝕾 Export Tags as Text (for LLMs)

Exports a collection's complete sorted tag list as plain text to the clipboard or a UTF-8 file, preserving hierarchical tags, with customizable keyboard shortcuts.

export

2 votes 34% approval 👍 2 · 👎 0 ⭐ 3 Anki 26.09~ Updated 2026-08-23
𝕾 Export Deck Tree as Text (for LLMs)

Exports the collection’s normal deck hierarchy as Markdown full paths, copied to the clipboard or saved as a UTF-8 file for use as LLM context or structural review.

exportdeck-management

4 votes 51% approval 👍 4 · 👎 0 ⭐ 3 Anki 26.09~ Updated 2026-08-23
𝕾 Export Deck Guide as Text (for LLMs)

Exports non-empty deck descriptions, with full deck paths and Markdown/HTML format markers, to the clipboard or a UTF-8 file for inspection and LLM context.

export

2 votes 34% approval 👍 2 · 👎 0 ⭐ 3 Anki 26.09~ Updated 2026-08-28
LLM Review Stats Exporter

Exports Anki review history to CSV or JSONL for use with LLMs, with deck, time, tag, interval, and field filters plus optional summary files.

exportstatistics

5 votes 57% approval 👍 5 · 👎 0 ⭐ 5 Anki 2.1.66~ Updated 2026-07-22

Description

Selected Notes to Structured Text lets one export a subset of one’s Anki collection while retaining the context needed to interpret it. The selected notes can be copied to the clipboard or saved as a text file.

Field contents are preserved unchanged—cloze markup, HTML, MathJax, Unicode, and media references remain exactly as stored in the Anki fields. Compact metadata include the note type, full deck path, and (by default) tags.

The output is especially useful as input to an LLM: existing notes can be reviewed in context or used as exemplars for generating new notes that follow the same conventions.

Usage

Notes menu with Structured Text commands

In the Browser, select one or more notes or cards, then choose either of the following menu items:

  • Notes → Copy as Structured Text
  • Notes → Save as Structured Text…

The same commands are available from the Browser context menu: in Notes mode, they appear directly; in Cards mode, they appear under Notes. Saved files are encoded in UTF-8 and have a default filename of the form anki-notes-YYYY-MM-DD.txt.

Configuration

The available options can be changed in the add-on’s configuration dialog:

Tools → Add-ons → Config

The default configuration includes tags and the principal textual fields of Anki’s built-in Basic, Cloze, and Image Occlusion note types.

Tags

Tags are included by default because they can supply context not contained in the note fields themselves, complementing the exported deck path.

For example, the prompt “Convert x to a string.” may be tagged Python or JavaScript; the corresponding answer can then be simply str(x) or String(x). Without such a tag, the programming language would have to be stated in the prompt or supplied by some other context, such as the deck hierarchy.

To omit tags, change "add_tags": true to "add_tags": false.

Fields

By default, the add-on includes the principal textual fields of Anki’s built-in Basic, Cloze, and Image Occlusion note types:

"fields": [
    "Front",
    "Back",
    "Text",
    "Header",
    "Back Extra",
    "Comments"
]

For custom note types, add their field names to this list in the desired output order.

A configured field that is not present in a particular note is simply omitted. A field that exists but is empty is retained as an empty field block. Whitespace contained in a field is preserved.

Shortcuts

The keyboard shortcuts can be changed in the add-on’s configuration dialog:

Tools → Add-ons → 𝕾 Selected Notes to Structured Text → Config

The default shortcut settings are:

{
    "shortcut_copy": "Meta+Ctrl+Shift+C",
    "shortcut_save": "Meta+Ctrl+Shift+S"
}

On macOS, Qt interprets Meta as Control (⌃), Ctrl as Command (⌘), Alt as Option (⌥), and Shift as Shift (⇧). The default shortcuts are therefore ⌃⇧⌘C for Copy as Structured Text and ⌃⇧⌘S for Save as Structured Text…

No restart is required.

Format

Each note is represented by an anki-note block containing its sequence number, Anki note ID, note type, full deck path, and, by default, tags. The block then contains the configured fields. An example:

<@anki-note n="1" nid="1786185354532" type="Basic" deck="9.CMP" tags="Python regex"@>
<@anki-field name="Front"@>
Return a regex-safe pattern for the literal string <code>a.b</code>.
</@anki-field@>
<@anki-field name="Back"@>
<code>re.escape("a.b")</code>
</@anki-field@>
</@anki-note@>

A Cloze note might appear as:

<@anki-note n="2" nid="1786187284450" type="Cloze" deck="9.CMP" tags="Python"@>
<@anki-field name="Text"@>
{{c1::A tuple}} is {{c2::an immutable sequence of elements}}.
</@anki-field@>
<@anki-field name="Back Extra"@>
<p>The referenced objects themselves may be mutable. If <code>t = ([1, 2], 3)</code>,
the tuple continues to reference the same list object at index <code>0</code>,
but that list object can still be mutated, e.g. by <code>t[0].append(4)</code>.</p>
</@anki-field@>
</@anki-note@>

The <@…@> delimiters are deliberately simple. They make note and field boundaries explicit without requiring the field contents themselves to be escaped or transformed. The format is designed to be easy for an LLM to parse while leaving the field contents unchanged.

The n attribute numbers notes within the generated output. The nid attribute records the Anki note ID, which can be used to locate the original note in the Browser by searching for nid:1786185354532.

The deck attribute records the full path of the deck of the note’s first card in template order. If that card is temporarily in a filtered deck, its original deck is used. For note types whose cards belong to different decks, only the deck of the first card is represented. The full path is retained because the deck hierarchy may itself provide context for interpreting the note.

Selection and ordering

In Notes mode, notes are written in their current Browser display order.

In Cards mode, the selected cards identify their underlying notes. Each note is written only once, at the position of its first selected card. Thus, if the selected cards correspond to notes B, A, C, B, the output contains the notes in the order B, A, C.

The add-on always converts notes rather than individual cards.

Preservation of field contents

Field contents are copied exactly as stored by Anki. Some examples:

{{c1::A tuple}}
<pre>s = "abcdef"<br>s[1:4]</pre>
[sound:example.mp3]
<img src="example.jpg">

Referenced media files themselves are not copied or embedded; their references remain part of the field contents.

The add-on does not modify the Anki collection.

Related add-ons

For collection context, see:

Compatibility

Tested with Anki 26.08 on macOS Tahoe 26.5. Windows and Linux have not yet been tested.

Suggestions and bug reports are welcome. Please open an issue on GitHub.

README

Selected Notes to Structured Text

This add-on lets one export a subset of one's Anki collection while retaining the context needed to interpret it. The selected notes can be copied to the clipboard or saved as a text file.

Field contents are preserved unchanged—cloze markup, HTML, MathJax, Unicode, and media references remain exactly as stored in the Anki fields. Compact metadata include the note type, full deck path, and (by default) tags.

The output is especially useful as input to an LLM: existing notes can be reviewed in context or used as exemplars for generating new notes that follow the same conventions.

Installation

Install Selected Notes to Structured Text from AnkiWeb using add-on code 1694585841.

Usage

Notes menu with Structured Text commands

In the Browser, select one or more notes or cards, then choose either of the following menu items:

  • Notes → Copy as Structured Text
  • Notes → Save as Structured Text…

The same commands are available from the Browser context menu: in Notes mode, they appear directly; in Cards mode, they appear under Notes. Saved files are encoded in UTF-8 and have a default filename of the form anki-notes-YYYY-MM-DD.txt.

Configuration

The available options can be changed in the add-on’s configuration dialog:

Tools → Add-ons → Config

The default configuration includes tags and the principal textual fields of Anki’s built-in Basic, Cloze, and Image Occlusion note types.

Tags

Tags are included by default because they can provide context not contained in the note fields themselves. They complement the deck path included with every exported note.

For instance, a command note can use the simple prompt:

Convert <code>x</code> to a string.

and be tagged Python or JavaScript. The corresponding answers can then be:

str(x)

or:

String(x)

Without tags, the programming language would have to be supplied in some other way—e.g., by writing “Convert x to a string in Python.” in the prompt or by organizing notes into language-specific decks. Tags thus preserve contextual information outside Anki without requiring it in the prompt itself.

To omit tags, change:

"add_tags": true

to:

"add_tags": false

Fields

By default, the add-on includes the principal textual fields of Anki’s built-in Basic, Cloze, and Image Occlusion note types:

"fields": [
    "Front",
    "Back",
    "Text",
    "Header",
    "Back Extra",
    "Comments"
]

For custom note types, add their field names to this list in the desired output order.

A configured field that is not present in a particular note is simply omitted. A field that exists but is empty is retained as an empty field block. Whitespace contained in a field is preserved.

Shortcuts

The keyboard shortcuts can be changed in the add-on’s configuration dialog:

Tools → Add-ons → 𝕾 Selected Notes to Structured Text → Config

The default shortcut settings are:

{
    "shortcut_copy": "Meta+Ctrl+Shift+C",
    "shortcut_save": "Meta+Ctrl+Shift+S"
}

On macOS, Qt interprets Meta as Control (⌃), Ctrl as Command (⌘), Alt as Option (⌥), and Shift as ⇧. The default shortcuts are therefore ⌃⇧⌘C for Copy as Structured Text and ⌃⇧⌘S for Save as Structured Text…

No restart is required.

Format

Each note is represented by an anki-note block containing its sequence number, Anki note ID, note type, full deck path, and, by default, tags. The block then contains the configured fields. An example:

<@anki-note n="1" nid="1786185354532" type="Basic" deck="9.CMP" tags="Python regex"@>
<@anki-field name="Front"@>
Return a regex-safe pattern for the literal string <code>a.b</code>.
</@anki-field@>
<@anki-field name="Back"@>
<code>re.escape("a.b")</code>
</@anki-field@>
</@anki-note@>

A Cloze note might appear as:

<@anki-note n="2" nid="1786187284450" type="Cloze" deck="9.CMP" tags="Python"@>
<@anki-field name="Text"@>
{{c1::A tuple}} is {{c2::an immutable sequence of elements}}.
</@anki-field@>
<@anki-field name="Back Extra"@>
<p>The referenced objects themselves may be mutable. If <code>t = ([1, 2], 3)</code>,
the tuple continues to reference the same list object at index <code>0</code>,
but that list object can still be mutated, e.g. by <code>t[0].append(4)</code>.</p>
</@anki-field@>
</@anki-note@>

The <@…@> delimiters are deliberately simple. They make note and field boundaries explicit without requiring the field contents themselves to be escaped or transformed. The format is designed to be easy for an LLM to parse while leaving the field contents unchanged.

The n attribute numbers notes within the generated output. The nid attribute records the Anki note ID, which can be used to locate the original note in the Browser by searching for nid:1786185354532.

The deck attribute records the full path of the deck of the note’s first card in template order. If that card is temporarily in a filtered deck, its original deck is used. For note types whose cards belong to different decks, only the deck of the first card is represented. The full path is retained because the deck hierarchy may itself provide context for interpreting the note.

Selection and ordering

In Notes mode, notes are written in their current Browser display order.

In Cards mode, the selected cards identify their underlying notes. Each note is written only once, at the position of its first selected card. Thus, if the selected cards correspond to notes B, A, C, B, the output contains the notes in the order B, A, C.

The add-on always converts notes rather than individual cards.

Preservation of field contents

Field contents are copied exactly as stored by Anki. Some examples:

{{c1::A tuple}}
<pre>s = "abcdef"<br>s[1:4]</pre>
[sound:example.mp3]
<img src="example.jpg">

Referenced media files themselves are not copied or embedded; their references remain part of the field contents.

The add-on does not modify the Anki collection.

Related add-ons

For collection context, see:

Compatibility

Tested with Anki 26.08 on macOS Tahoe 26. Windows and Linux have not yet been tested.

Suggestions and bug reports are welcome. Please open an issue on GitHub.

License

Licensed under the GNU AGPL v3 or later.