abdo
July 3, 2023, 11:53pm
2
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:
from __future__ import annotations
import functools
import os
import sys
import time
import zipfile
from anki.cards import Card, CardId
from anki.collection import Collection, OpChangesWithCount
from anki.consts import CardQueue, CardType
from anki.utils import tmpfile
from aqt import mw
from aqt.operations import CollectionOp
from aqt.qt import *
from aqt.utils import getFile, tooltip
sys.path.append(os.path.join(os.path.dirname(__file__), "vendor"))
try:
import pyzstd
This file has been truncated. show original
2 Likes