b2sdk.transfer.inbound.downloader.range – transfer range toolkit

class b2sdk.transfer.inbound.downloader.range.Range(start, end)[source]

Bases: object

HTTP ranges use an inclusive index at the end.

__init__(start, end)[source]

Initialize self. See help(type(self)) for accurate signature.

classmethod from_header(raw_range_header)[source]

Factory method which returns an object constructed from Range http header.

raw_range_header example: ‘bytes=0-11’

size()[source]
subrange(sub_start, sub_end)[source]

Return a range that is part of this range.

Parameters
  • sub_start – index relative to the start of this range.

  • sub_end – (Inclusive!) index relative to the start of this range.

Returns

a new Range

as_tuple()[source]