Skip to content

RemoteFileSubscriptionStreamReader

QuantConnect.Lean.Engine.DataFeeds.Transport.RemoteFileSubscriptionStreamReader

RemoteFileSubscriptionStreamReader(
    data_cache_provider: IDataCacheProvider,
    source: str,
    download_directory: str,
    headers: List[KeyValuePair[str, str]],
)

Bases: Object, IStreamReader

Represents a stream reader capabable of downloading a remote file and then reading it from disk

Initializes a new instance of the RemoteFileSubscriptionStreamReader class.

Parameters:

Name Type Description Default
data_cache_provider IDataCacheProvider

The IDataCacheProvider used to retrieve a stream of data

required
source str

The remote url to be downloaded via web client

required
download_directory str

The local directory and destination of the download

required
headers List[KeyValuePair[str, str]]

Defines header values to add to the request

required

should_be_rate_limited

should_be_rate_limited: bool

Gets whether or not this stream reader should be rate limited

stream_reader

stream_reader: StreamReader

Direct access to the StreamReader instance

local_file_name

local_file_name: str

The local file name of the downloaded file

transport_medium

transport_medium: SubscriptionTransportMedium

Gets SubscriptionTransportMedium.REMOTE_FILE

end_of_stream

end_of_stream: bool

Gets whether or not there's more data to be read in the stream

dispose

dispose() -> None

Disposes of the stream

read_line

read_line() -> str

Gets the next line/batch of content from the stream

set_download_provider

set_download_provider(
    downloader: IDownloadProvider,
) -> None

Save reference to the download system.

Parameters:

Name Type Description Default
downloader IDownloadProvider

Downloader provider for the remote file fetching.

required