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[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 ThreadPoolExecutor

DEFAULT_ALIGN_FACTOR = 4096
__init__(thread_pool: Optional[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: 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: IOBase, response: Response, download_version: DownloadVersion, session: B2Session, encryption: Optional[EncryptionSetting] = None)[source]

@returns (bytes_read, actual_sha1)