StorageStreamDownloader class

Definition

A streaming object to download from Azure Storage.

The stream downloader can iterated, or download to open file or stream over multiple threads.

StorageStreamDownloader(clients=None, config=None, offset=None, length=None, validate_content=None, encryption_options=None, **kwargs)
Inheritance
builtins.object
StorageStreamDownloader

Methods

content_as_bytes(max_concurrency=1)

Download the contents of this file.

This operation is blocking until all data is downloaded.

content_as_text(max_concurrency=1, encoding='UTF-8')

Download the contents of this file, and decode as text.

This operation is blocking until all data is downloaded.

download_to_stream(stream, max_concurrency=1)

Download the contents of this file to a stream.

setup(extra_properties=None)

content_as_bytes(max_concurrency=1)

Download the contents of this file.

This operation is blocking until all data is downloaded.

content_as_bytes(max_concurrency=1)

Parameters

max_concurrency
int

The number of parallel connections with which to download.

default value: 1

Return type

content_as_text(max_concurrency=1, encoding='UTF-8')

Download the contents of this file, and decode as text.

This operation is blocking until all data is downloaded.

content_as_text(max_concurrency=1, encoding='UTF-8')

Parameters

max_concurrency
int

The number of parallel connections with which to download.

default value: 1
encoding
default value: UTF-8

Return type

str

download_to_stream(stream, max_concurrency=1)

Download the contents of this file to a stream.

download_to_stream(stream, max_concurrency=1)

Parameters

stream

The stream to download to. This can be an open file-handle, or any writable stream. The stream must be seekable if the download uses more than one parallel connection.

max_concurrency
default value: 1

Returns

The properties of the downloaded file.

Return type

Any

setup(extra_properties=None)

setup(extra_properties=None)

Parameters

extra_properties
default value: None