b2sdk.transfer.inbound.downloader.abstract – Downloader base class

class b2sdk.transfer.inbound.downloader.abstract.EmptyHasher(*args, **kwargs)[source]

Bases: object

__init__(*args, **kwargs)[source]
update(data)[source]
digest()[source]
hexdigest()[source]
copy()[source]
class b2sdk.transfer.inbound.downloader.abstract.AbstractDownloader(thread_pool: Optional[concurrent.futures.thread.ThreadPoolExecutor] = None, force_chunk_size: Optional[int] = None, min_chunk_size: Optional[int] = None, max_chunk_size: Optional[int] = None, align_factor: Optional[int] = None, check_hash: bool = True, **kwargs)[source]

Bases: object

REQUIRES_SEEKING = True
DEFAULT_THREAD_POOL_CLASS

alias of concurrent.futures.thread.ThreadPoolExecutor

DEFAULT_ALIGN_FACTOR = 4096
__init__(thread_pool: Optional[concurrent.futures.thread.ThreadPoolExecutor] = None, force_chunk_size: Optional[int] = None, min_chunk_size: Optional[int] = None, max_chunk_size: Optional[int] = None, align_factor: Optional[int] = None, check_hash: bool = True, **kwargs)[source]
is_suitable(download_version: b2sdk.file_version.DownloadVersion, allow_seeking: bool)[source]

Analyze download_version (possibly against options passed earlier to constructor to find out whether the given download request should be handled by this downloader).

abstract download(file: io.IOBase, response: requests.models.Response, download_version: b2sdk.file_version.DownloadVersion, session: b2sdk.session.B2Session, encryption: Optional[b2sdk.encryption.setting.EncryptionSetting] = None)[source]

@returns (bytes_read, actual_sha1)