Is there any way to open the collection.anki21b file through Python?

I would like to update the addon Partial import from apkg file (mizmu) - AnkiWeb so that it will also support the new anki files. But I’m running into a problem - I haven’t found any way to decompress zstd files by Anki addons. because:
-There is no built-in library in Anki Python that supports this. The whole import process is done by backend which just puts the file into the current col. There is no way to only decompress the file by him.

  • There is no pure Python library that decompresses these files. All libraries are compiled into a C file and Anki does not support addons with such libraries.

Did I miss something?

You can use a package like pyzstd to do that (You have to bundle it with your add-on). I have an add-on that uses pyzstd to read files in the new format. See for an example:


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.