Anki
anki
¶
Defines stateless helpers for exporting a profile's saved clips as an Anki
deck using genanki
Attributes:
| Name | Type | Description |
|---|---|---|
VIDEO_CSS |
str
|
Pre-defined CSS of the cards |
CARD_TEMPLATE |
list
|
Pre-defined template of the cards for |
MODEL_FIELDS |
list
|
Pre-defined card model fields |
MODEL_NAME |
str
|
Pre-defined standard model name |
DECK_NAME |
str
|
Pre-defined standard deck name |
VIDEO_TAG |
str
|
HTML |
AnkiCard
dataclass
¶
Data for a single Anki card built from a saved clip
Attributes:
| Name | Type | Description |
|---|---|---|
clip_path |
str
|
Absolute path to the clip file, bundled as card media |
word |
str
|
The focus word shown on the card front |
meanings |
str
|
The word's meanings as a single string |
sentence |
str
|
The sentence the word came from |
explanation |
str
|
The LLM explanation of the sentence |
tags |
list[str]
|
Optional card tags |
build_model()
¶
Builds the shared genanki.Model used for every Mirumoji card
Returns:
| Type | Description |
|---|---|
Model
|
The configured |
export_deck(cards, output_path)
¶
Builds a deck from cards and writes it (with bundled clip media) to disk
Each card's clip_path is bundled into the package as media and embedded
in the card via an HTML <video> tag referencing the file's base name
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cards
|
list[AnkiCard]
|
The cards to add to the deck |
required |
output_path
|
str
|
Path to write the resulting |
required |