kerrickstaley / genanki

A Python 3 library for generating Anki decks
MIT License
1.99k stars 150 forks source link

Could we use an existing Card Type when creating a deck? #111

Closed oal55 closed 1 year ago

oal55 commented 2 years ago

Hello,

I am not sure if opening an issue is the best way to ask questions, feel absolutely free to defer/close the issue if this is not the place for such Qs.

I am looking to generate a deck of 2-field cards. I was wondering if it is possible to use an existing card type that's registered on my anki account?

Best, Orbay

chambln commented 2 years ago

I don't know if that's possible but for what it's worth, models for the built-in note types are included with genanki:

genanki.BASIC_AND_REVERSED_CARD_MODEL,
genanki.BASIC_MODEL,
genanki.BASIC_OPTIONAL_REVERSED_CARD_MODEL,
genanki.BASIC_TYPE_IN_THE_ANSWER_MODEL,
genanki.CLOZE_MODEL

Can you re-create the note type as a genanki.Model object, import a deck that uses it and then, from inside Anki, change the note type of any existing notes of your original note type to the new note type?

kerrickstaley commented 1 year ago

As chambln mentioned, you should use genanki.BASIC_MODEL etc to get the same behavior as the built-in models.

These are not the same as the Anki built-in models for silly technical reasons, but they behave exactly the same way.