Write intent

class b2sdk.v2.WriteIntent[source]

Wrapper for outbound source that defines destination offset.

__init__(outbound_source, destination_offset=0)[source]
Parameters
property length

Length of the write intent.

Return type

int

property destination_end_offset

Offset of source end in destination file.

Return type

int

is_copy()[source]

States if outbound source is remote source and requires copying.

Return type

bool

is_upload()[source]

States if outbound source is local source and requires uploading.

Return type

bool

classmethod wrap_sources_iterator(outbound_sources_iterator)[source]

Helper that wraps outbound sources iterator with write intents.

Can be used in cases similar to concatenate to automatically compute destination offsets

Param

iterator[b2sdk.v2.OutboundTransferSource] outbound_sources_iterator: iterator of outbound sources

Return type

generator[b2sdk.v2.WriteIntent]