neuralib.io.dataset.google_drive_file

neuralib.io.dataset.google_drive_file(file_id, *, quiet=False, output_dir=None, rename_file=None, cached=False, invalid_cache=False)[source]

Download file from Google Drive. If not cached, then delete afterward.

Parameters:
  • file_id (str) – Google Drive file ID used to identify the file to be downloaded.

  • quiet (bool) – Boolean flag to suppress output from the download process.

  • output_dir (str | Path | PathLike[str] | None) – Directory path where the downloaded file will be saved.

  • rename_file (str | None) – Optional string to rename the downloaded file.

  • cached (bool) – Boolean flag to retain the downloaded file after usage.

  • invalid_cache (bool) – Boolean flag to force re-download even if the file exists in the cache.

Returns:

A context manager yielding the path to the downloaded file.

Return type:

Iterator[Path]