Directory.download

Directory.download(path, *, overwrite=False, max_results=None, progress=True, max_parallelization=None, max_concurrency=None) → void

Downloads files in the directory to the specified path.

Parameters:

path : str | pathlib.Path The path of the directory to download files. Will automatically create the directory if it doesn't exist. If not specified, defaults to Path.cwd() / Directory.name .

overwrite : bool, default False Whether to overwrite any existing files when downloading. If False, will throw an error if a file with the same name already exists at the provided path.

max_results : int, default None If specified, will only download up to the specified number of files

progress : bool, default True Whether to show the progress bar.

max_parallelization : int, default None The maximum number of threads to use to download files. If unset (recommended), will be determined dynamically based on the number of files, their size, and available cores on your machine.

max_concurrency : int, default None The maximum total concurrency when downloading files. Should be higher than max_parallelization, as multiple files are downloaded concurrently per thread. If unset (recommended), will be determined dynamically based on the number of files, their size, and available cores on your machine.

Returns:

void

Examples:

import redivis

dir = redivis.table("table_ref").to_directory()

file = dir.get("path/to/file.txt") # Will return None if doesn't exist
subdir = dir.get("path/to/subdir")

print(subdir.get("../").path) # -> "/path/to"
rootdir = subdir.get("/")

Last updated

Was this helpful?