Skip to main content

put

Uploads a file or directory from a local path to a remote path using the appropriate filesystem. It handles both synchronous and asynchronous file system operations.

def put(
from_path: str,
to_path: Optional[str] = None,
recursive: bool = False,
batch_size: Optional[int] = None,
kwargs: Any
) - > str

Uploads a file or directory from a local path to a remote path. If 'to_path' is not provided, a random remote path will be generated.

Parameters

NameTypeDescription
from_pathstrThe local path to the file or directory to be uploaded.
to_pathOptional[str] = NoneThe remote destination path. If not specified, a random remote path will be generated.
recursivebool = FalseA boolean indicating whether to upload directories recursively.
batch_sizeOptional[int] = NoneThe number of files to upload in a single batch. If not specified, a default batch size will be used.
kwargsAnyAdditional keyword arguments to pass to the underlying filesystem's put method.

Returns

TypeDescription
strThe remote path where the file or directory was uploaded.