Skip to content

ZipEntryNameSubscriptionDataSourceReader

QuantConnect.Lean.Engine.DataFeeds.ZipEntryNameSubscriptionDataSourceReader

ZipEntryNameSubscriptionDataSourceReader(
    data_provider: IDataCacheProvider,
    config: SubscriptionDataConfig,
    date: Union[datetime, date],
    is_live_mode: bool,
)

Bases: BaseSubscriptionDataSourceReader

Provides an implementation of ISubscriptionDataSourceReader that reads zip entry names

Initializes a new instance of the ZipEntryNameSubscriptionDataSourceReader class

Parameters:

Name Type Description Default
data_provider IDataCacheProvider

Used to fetch data

required
config SubscriptionDataConfig

The subscription's configuration

required
date Union[datetime, date]

The date this factory was produced to read data for

required
is_live_mode bool

True if we're in live mode, false for backtesting

required

invalid_source

invalid_source: _EventContainer[
    Callable[[Object, InvalidSourceEventArgs], Any], Any
]

Event fired when the specified source is considered invalid, this may be from a missing file or failure to download a remote source

is_live_mode

is_live_mode: bool

True if we're in live mode, false for backtesting

This codeEntityType is protected.

data_cache_provider

data_cache_provider: IDataCacheProvider

The data cache provider to use

This codeEntityType is protected.

object_store

object_store: IObjectStore

The object store to use

This codeEntityType is protected.

read

read(source: SubscriptionDataSource) -> Iterable[BaseData]

Reads the specified source

Parameters:

Name Type Description Default
source SubscriptionDataSource

The source to be read

required

Returns:

Type Description
Iterable[BaseData]

An IEnumerable{BaseData} that contains the data in the source.

create_stream_reader

create_stream_reader(
    subscription_data_source: SubscriptionDataSource,
) -> IStreamReader

Creates a new IStreamReader for the specified subscription_data_source

This codeEntityType is protected.

Parameters:

Name Type Description Default
subscription_data_source SubscriptionDataSource

The source to produce an IStreamReader for

required

Returns:

Type Description
IStreamReader

A new instance of IStreamReader to read the source, or null if there was an error.

on_invalid_source

on_invalid_source(
    source: SubscriptionDataSource, exception: Exception
) -> None

Event invocator for the invalid_source event

This codeEntityType is protected.

Parameters:

Name Type Description Default
source SubscriptionDataSource

The SubscriptionDataSource that was invalid

required
exception Exception

The exception if one was raised, otherwise null

required