anki.importing.noteimp#

Attributes#

Classes#

ForeignNote

An temporary object storing fields and attributes.

ForeignCard

NoteImporter

Module Contents#

anki.importing.noteimp.TagMappedUpdate#
anki.importing.noteimp.TagModifiedUpdate#
anki.importing.noteimp.NoTagUpdate#
anki.importing.noteimp.Updates#
class anki.importing.noteimp.ForeignNote#

An temporary object storing fields and attributes.

fields: list[str] = []#
tags: list[str] = []#
deck = None#
cards: dict[int, ForeignCard]#
fieldsStr = ''#
class anki.importing.noteimp.ForeignCard#
due = 0#
ivl = 1#
factor = 2500#
reps = 0#
lapses = 0#
anki.importing.noteimp.UPDATE_MODE = 0#
anki.importing.noteimp.IGNORE_MODE = 1#
anki.importing.noteimp.ADD_MODE = 2#
class anki.importing.noteimp.NoteImporter(col: anki.collection.Collection, file: str)#

Bases: anki.importing.base.Importer

needMapper = True#
needDelimiter = False#
allowHTML = False#
importMode = 0#
mapping: list[str] | None#
tagModified: str | None#
model#
run() None#

Import.

fields() int#

The number of fields.

initMapping() None#
mappingOk() bool#
foreignNotes() list#

Return a list of foreign notes for importing.

importNotes(notes: list[ForeignNote]) None#

Convert each card into a note, apply attributes and add to col.

newData(n: ForeignNote) tuple[anki.notes.NoteId, str, anki.models.NotetypeId, int, int, str, str, str, int, int, str]#
addNew(rows: list[tuple[anki.notes.NoteId, str, anki.models.NotetypeId, int, int, str, str, str, int, int, str]]) None#
updateData(n: ForeignNote, id: anki.notes.NoteId, sflds: list[str]) Updates | None#
addUpdates(rows: list[Updates]) None#
processFields(note: ForeignNote, fields: list[str] | None = None) None#
updateCards() None#