I'm currently testing my algorithm with custom data, when I use .csv file everything works fine but when I try to switch to a zip file I get this error.

221903_1679301269.jpg

 

I can't find any reference code for using a zip file and would appreciate your help, this is the custom data class.

class MyCustomDataType(PythonData):
    def GetSource(
        self, config: SubscriptionDataConfig, date: datetime, isLive: bool
    ) -> SubscriptionDataSource:
        return SubscriptionDataSource(
            "https://www.dropbox.com/s/brwzhl2wgl13qx0/SNAP.zip?dl=1",
            SubscriptionTransportMedium.RemoteFile,
            FileFormat.ZipEntryName,
        )

    def Reader(
        self, config: SubscriptionDataConfig, line: str, date: datetime, isLive: bool
    ) -> BaseData:

        if not (line.strip() and line[0].isdigit()):
            return None

        index = MyCustomDataType()

        index.Symbol = config.Symbol

        # Example File Format:
        #                Date        Open       High        Low       Close     Volume      Turnover
        # 2023-01-17 11:30:00-05:00  7792.9    7799.9     7722.65    7748.7    116534670    6107.78

        data = line.split(",")
        index.Time = datetime.strptime(data[0][:-6], "%Y-%m-%d %H:%M:%S")
        index.EndTime = index.Time + timedelta(seconds=1)
        index.Value = float(data[4])
        index["Open"] = float(data[1])
        index["High"] = float(data[2])
        index["Low"] = float(data[3])
        index["Close"] = float(data[4])
        index["Volume"] = float(data[5]) * 100

        return index