Tag to Deck Hierarchy
An Anki add-on that builds a deck hierarchy
from an existing tag hierarchy and moves the matching cards into the
correct sub-decks. Disclaimer: This tool was quickly coded with Claude Opus 4.8. It is a very useful tool to me and some of my study-buddies, thats why I thought I'd share. :)
AnkiWeb listing: (add the link here once published)
Why?
Anki uses the same separator (::) for both tags and decks to represent
hierarchies. If you organize your cards mainly through tags (e.g.
Medicine::Neurology::HSP) but want a matching deck structure for
studying β say, to drill a specific sub-topic or see per-topic statistics β
you'd normally have to search for and move cards by hand. This add-on
automates that step.
Features
- Pick any (nested) tag as the starting point.
- Automatically creates a main deck plus all matching sub-decks mirroring
the tag structure.
- Custom name for the main deck, independent of the tag name.
- Custom parent deck β nest the new structure under an existing deck.
- Searchable pickers: typing filters tags/decks with a "contains" match,
not just a prefix match.
- Automatically moves the cards of matching notes into the correct
(most specific or topmost β configurable) deck.
- Optionally creates empty sub-decks too, so the structure fully mirrors
the tag hierarchy.
- Tags are never changed or deleted β only card-to-deck assignment
changes.
Usage
- Tools β Build Deck Hierarchy From Tagsβ¦
- Pick or type the source tag (e.g.
Medicine::Neurology).
- Set a name for the new main deck.
- Optionally pick a parent deck under which the new structure should be
nested.
- Click OK β the decks are created and the cards moved accordingly.
Settings
Via Add-ons β Config for this add-on:
| Option |
Default |
Meaning |
assign_to_most_specific |
true |
If a note has several matching tags: move its cards to the most specific (deepest) matching deck instead of the topmost one. |
create_empty_decks |
true |
Also create sub-decks that don't currently have any cards, so the structure is complete. |
Compatibility
Tested with current Anki desktop releases (Qt6 backend). Requires the
modern CollectionOp API (Anki >= 2.1.45).
License
AGPL-3.0, same as Anki itself.
Contributing / Reporting bugs
Issues and pull requests are welcome: (https://github.com/dariores/)