kerrickstaley / genanki

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

Request for Collection (.colpkg) Creation Feature #122

Closed nnzv closed 7 months ago

nnzv commented 1 year ago

Description

Could you please add a direct method to create Anki collection packages (.apkg) in the genanki library?

Expected Behavior

It would be really helpful if there was a function that could take the decks and notes we create and turn them into a complete .colpkg collection. This would make things easier for us and save time when we want to make and share decks.

Thank you so much for looking into this. Your help means a lot!

kerrickstaley commented 10 months ago

What is the use-case for this? According to the docs you linked, a .colpkg file represents the entire collection:

A collection package is used to back up your collection, or copy it to another device. ... When this file is later imported, Anki will delete all the current cards in the collection, and replace the collection with the items in the file.

I think the workflow that most people want with genanki is to create a deck that they can share with others. If they were to export it as a .colpkg then when others import the deck they would lose all their existing cards.

Are you trying to put multiple decks in a single package? genanki.Package already supports that, just write genanki.Package([my_deck1, my_deck2, ...]).

kerrickstaley commented 7 months ago

Closing for now; please re-open this issue if you are able to provide more context about the use-case.