Skip to main content

get

Asynchronously retrieves a file or directory from a specified source path and saves it to a local destination. Automatically resolves destination paths or generates a random local path if omitted, falling back to anonymous filesystem access if initial retrieval fails.

async def get(from_path: str, to_path: Optional[str | pathlib.Path] = None, recursive: bool = False, **kwargs) -> str: ...

Downloads or copies files or directories from a source path to a local destination, automatically determining the destination path and attempting anonymous access if initial retrieval fails.

Parameters​

NameTypeDescription
from_pathstrThe source URI or file path from which data is retrieved.
to_path`Optional[strpathlib.Path]` = None
recursivebool = FalseWhether to recursively download all files and subdirectories if the source path is a directory.
kwargsAnyAdditional keyword arguments forwarded to the underlying filesystem get implementation.

Returns​

TypeDescription
strThe local destination file or directory path where the data was saved.