download_from_databricks#

download_from_databricks(remote_path: str, local_path: str | Path) None[source]#

Download content from a Databricks volume to a local directory.

This function can download either a single file or an entire folder (including all nested files and subdirectories) from a specified remote path to a local destination.

Parameters:
remote_pathstr

Path to the file or folder within the volume to download.

local_pathstr or Path

Local directory path where files will be saved.

Returns:
None

This function does not return any value but prints progress information to standard output.

Note

  • Progress is printed to standard output during download.

  • Existing files at the destination will be overwritten without confirmation.

  • For single file downloads, the file will be saved in the local_path with its original name.

Warning

  • The function will fail if environment variables DATABRICKS_TOKEN and DATABRICKS_HOST are not set.

Examples

>>> # Download a directory
>>> download_folder(
...     "data/reports",
...     "./local_data",
... )
Downloaded: /path/to/local_data/file1.csv
Downloaded: /path/to/local_data/subdir/file2.csv
>>> # Download a single file
>>> download_folder(
...     "data/reports/report.csv",
...     "./local_data",
... )
Downloaded: /path/to/local_data/report.csv