pytower.image_backends.backend

class pytower.image_backends.backend.ResourceBackend(name)[source]

Base class for the resource-uploading backends used by pytower backup and pytower fix

Parameters:

name (str)

__init__(name)[source]
Parameters:

name (str) – Printed name for this backend

abstract upload_file(path)[source]

upload_file takes as input a path and returns the uploaded url

Parameters:

path (str) – Path to the file to upload

Return type:

str | None

Returns:

Uploaded URL as a string, or None if failed

upload_files(files)[source]

Upload multiple files. Default implementation can be overridden for performance and to avoid rate limiting

Parameters:

files (Iterable[str]) – List of file paths

Return type:

dict[str, str]

Returns:

Dictionary where paths are keys and urls are values