Skip to content

SingleEntryDataCacheProvider

QuantConnect.Lean.Engine.DataFeeds.SingleEntryDataCacheProvider

SingleEntryDataCacheProvider(
    data_provider: IDataProvider,
    is_data_ephemeral: bool = True,
)

Bases: Object, IDataCacheProvider

Default implementation of the IDataCacheProvider Does not cache data. If the data is a zip, the first entry is returned

Constructor that takes the IDataProvider to be used to retrieve data

is_data_ephemeral

is_data_ephemeral: bool

Property indicating the data is temporary in nature and should not be cached.

dispose

dispose() -> None

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

fetch

fetch(key: str) -> Stream

Fetch data from the cache

Parameters:

Name Type Description Default
key str

A string representing the key of the cached data

required

Returns:

Type Description
Stream

An Stream of the cached data.

get_zip_entries

get_zip_entries(zip_file: str) -> List[str]

Returns a list of zip entries in a provided zip file

store

store(key: str, data: List[int]) -> None

Not implemented

Parameters:

Name Type Description Default
key str

The source of the data, used as a key to retrieve data in the cache

required
data List[int]

The data to cache as a byte array

required