import os import subprocess class Datasets: @staticmethod def download_kaggle_dataset(dataset_id, download_path): os.environ["KAGGLE_CONFIG_DIR"] = os.path.expanduser("~/.kaggle") command = ["kaggle", "datasets", "download", "-d", dataset_id, "-p", download_path] try: subprocess.run(command, check=True) print(f"Dataset downloaded successfully to {download_path}") except subprocess.CalledProcessError as e: print(f"Error downloading dataset: {e}")