Kaggle / kaggle-api

Official Kaggle API
Apache License 2.0
6.13k stars 1.08k forks source link

Extract after download? #9

Open kmader opened 6 years ago

kmader commented 6 years ago

It would be great to extract after download so kernels on kaggle could be easily run locally with a small prefix to download the data to ../input/ Some zip files are extracted into new folders (stage1_....zip) while others (csv.zip) are extracted to the input directory

kmader commented 6 years ago

Currently my prefix for the current data-science-bowl looks like this

import os
if not os.path.exists('../input'):
    !kaggle competitions download -c data-science-bowl-2018 -wp dsb2018
    !mkdir ../input
    !mv dsb2018/data-science-bowl-2018/* ../input
    !cd ../input; ls *.zip|awk -F'.zip' '{print "unzip "$0" -d "$1}'|sh > null
    !mkdir ../input/csvs
    !mv ../input/*.csv ../input/csvs
    !mv ../input/csvs/*/*.csv ../input/
neomatrix369 commented 4 years ago

I have an issue, and maybe it's similar, the below command does not unzip/extract the downloaded files even after passing the --unzip flag

kaggle datasets download -f ${each_file} -p "${DOWNLOAD_PATH}" --unzip "${DATASET_NAME}"
vijayphoenix commented 4 years ago

Faced a similar issue https://github.com/Kaggle/kaggle-api/issues/259

jacobeturpin commented 4 years ago

Same issue as others are reporting. The --unzip parameter appears to silently fail. Regardless of dataset or params, I'm unable to get the download to be unzipped via CLI.

kaggle datasets download maxhorowitz/nflplaybyplay2009to2016 --unzip -f "NFL Play by Play 2009-2018 (v5).csv" -p ./data

This will produce a .csv.zip file on every execution.

felixm3 commented 1 year ago

Is this still a pending issue for the kaggle datasets command?

Including the --unzip doesn't seem to do anything i.e. the downloaded file is not unzipped.

Below command downloads the requested file but does not unzip it.


kaggle datasets download \
    pourchot/targets-multiome-sparse-scaled \
    -f pca_target.pkl \
    --unzip