Skip to main content

get

No overview available.

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

Fetches a file or directory from a specified path and saves it to a local destination. This function handles various file systems and can perform recursive fetches for directories, attempting an anonymous fetch if the initial attempt fails.

Parameters

NameTypeDescription
from_pathstrThe source path of the file or directory to fetch. This can be a path on a remote file system (e.g., S3, Azure Blob Storage) or a local path.
to_path`Optional[strpathlib.Path]` = None
recursivebool = FalseA boolean indicating whether to fetch contents recursively if from_path is a directory. If True, all files and subdirectories within from_path will be fetched.
kwargsAnyAdditional keyword arguments to pass to the underlying file system operations, such as credentials or specific configuration options.

Returns

TypeDescription
strThe path to the locally saved file or directory.