download_or_copy#

download_or_copy(uri: str, target_dir: str, delete_tmp: bool = False, fs: Optional[FileSystem] = None) str[source]#

Downloads or copies a file to a directory.

Downloads or copies URI into target_dir.

Parameters
  • uri (str) – URI of file.

  • target_dir (str) – Local directory to download or copy file to.

  • delete_tmp (bool) – Delete temporary download dir after copying file.

  • fs (Optional[FileSystem]) – If supplied, use fs instead of automatically chosen FileSystem for uri.

Returns

the local path of file

Return type

str