Directory.download

Directory.download(path, *, overwrite=False, max_results=None, progress=True, max_parallelization=os.cpu_count() * 5) → 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 os.cpu_count() * 5 The maximum concurrency when downloading files. Higher numbers are better for lots of small files, while lower numbers will improve performance with several large files.

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?