b2sdk._internal.transfer.inbound.downloader.simple – SimpleDownloader

class b2sdk._internal.transfer.inbound.downloader.simple.SimpleDownloader(thread_pool=None, force_chunk_size=None, min_chunk_size=None, max_chunk_size=None, align_factor=None, check_hash=True, **kwargs)[source]

Bases: AbstractDownloader

Parameters:
REQUIRES_SEEKING = False
SUPPORTS_DECODE_CONTENT = True
download(file, response, download_version, session, encryption=None)[source]

Download target to a file-like object.

Parameters:
  • file (IOBase) – file-like object to write to

  • response (Response) – requests.Response of b2_download_url_by_* endpoint with the target object

  • download_version (DownloadVersion) – DownloadVersion of an object being downloaded

  • session (B2Session) – B2Session to be used for downloading

  • encryption (Optional[EncryptionSetting]) – optional Encryption setting

Returns:

(bytes_read, actual_sha1) please note bytes_read may be different from bytes written to a file object if decode_content=True

__init__(thread_pool=None, force_chunk_size=None, min_chunk_size=None, max_chunk_size=None, align_factor=None, check_hash=True, **kwargs)
Parameters: