b2sdk.upload_source

class b2sdk.upload_source.AbstractUploadSource[source]

Bases: object

The source of data for uploading to b2.

abstract get_content_length()[source]

Return the number of bytes of data in the file.

abstract get_content_sha1()[source]

Return a 40-character string containing the hex SHA1 checksum of the data in the file.

abstract open()[source]

Return a binary file-like object from which the data can be read. :return:

class b2sdk.upload_source.UploadSourceBytes(data_bytes)[source]

Bases: b2sdk.upload_source.AbstractUploadSource

__init__(data_bytes)[source]

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

get_content_length()[source]

Return the number of bytes of data in the file.

get_content_sha1()[source]

Return a 40-character string containing the hex SHA1 checksum of the data in the file.

open()[source]

Return a binary file-like object from which the data can be read. :return:

class b2sdk.upload_source.UploadSourceLocalFile(local_path, content_sha1=None)[source]

Bases: b2sdk.upload_source.AbstractUploadSource

__init__(local_path, content_sha1=None)[source]

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

get_content_length()[source]

Return the number of bytes of data in the file.

get_content_sha1()[source]

Return a 40-character string containing the hex SHA1 checksum of the data in the file.

open()[source]

Return a binary file-like object from which the data can be read. :return: