Skip to content

Allow kagglehub.dataset_download to download entire dataset to a specified directory #214

Open
@Montekkundan

Description

@Montekkundan

When using kagglehub.dataset_download, the path parameter appears to be designed for downloading a specific file from the dataset rather than defining a destination directory on the user's machine. This creates confusion and limits functionality, especially when a user want to download the entire dataset directly to their current working directory or a specified folder.

For example, the following code:

import kagglehub

path = kagglehub.dataset_download("preritbhagat/stress-non-stress-images", path="./data")

print("Path to dataset files:", path)

this results in a 404 error

i tried with

import kagglehub

# Download latest version
path = kagglehub.dataset_download("preritbhagat/stress-non-stress-images" , path="FINAL_TFEID/FINALTFEID_NONSTRESS/f01_dfh_hx.jpg")

print("Path to dataset files:", path)

this downloads the single image, as documented in the docs of this function; where FINAL_TFEID/FINALTFEID_NONSTRESS/f01_dfh_hx.jpg is the path of the file in that dataset.

  • Is there currently a way to download an entire dataset to a specific directory (e.g., ./data or the current working directory) using kagglehub.dataset_download?
  • If not, would it be possible to enhance the function to include a parameter (e.g., destination) for specifying a custom download location for the entire dataset?

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions