Outbound Transfer Source

class b2sdk.v2.OutboundTransferSource[source]

Abstract class for defining outbound transfer sources.

Supported outbound transfer sources are:

  • b2sdk.v2.CopySource

  • b2sdk.v2.UploadSourceBytes

  • b2sdk.v2.UploadSourceLocalFile

  • b2sdk.v2.UploadSourceLocalFileRange

  • b2sdk.v2.UploadSourceStream

  • b2sdk.v2.UploadSourceStreamRange

abstract get_content_length() int[source]

Returns the number of bytes of data in the file.

abstract get_content_sha1() Optional[Sha1HexDigest][source]

Return a 40-character string containing the hex SHA1 checksum, which can be used as the large_file_sha1 entry.

This method is only used if a large file is constructed from only a single source. If that source’s hash is known, the result file’s SHA1 checksum will be the same and can be copied.

If the source’s sha1 is unknown and can’t be calculated, None is returned.

abstract is_upload() bool[source]

Returns True if outbound source is an upload source.

abstract is_copy() bool[source]

Returns True if outbound source is a copy source.