Below is an overview of how to install kaggle-cli and extract data for planet competition located at https://www.kaggle.com/c/planet-understanding-the-amazon-from-space as an example. You can apply the same for any other competition.
Step by Step Guide to setup Kaggle CLI and download Data
- Install Kaggle CLI (if done, Go to Step 2)
pip install –U kaggle-cli
- Configure your kaggle account
kg config –u <your username> -p <your password> -c <competition name>
Note:
- Go to Kaggle Competition Website, Login and accept the rules of competition
- If you’ve always signed into Kaggle using a linked social media account, you will get an error using the kaggle cli, which requires that you have a separate kaggle login. Fortunately, Kaggle has a solution: if you select *Forgot Password?*, you’ll receive an email with a few different options, the 3rd of which lets you set up your own Kaggle username/password and connects it to your original social media account
- How to find Kaggle competition name – Go to Kaggle competition page in kaggle website and take the name. For ex – if page is https://www.kaggle.com/c/planet-understanding-the-amazon-from-space, then competition name is planet-understanding-the-amazon-from-space
3. Download the data
kg download
- Extract data: zip files
Unzip –q <filename.zip>
- Extract data: tar files. This extracts 7z format and delivers an output <filename.tar>
7za x <filename.tar.7z>
tar xf <filename.tar>
- You only need the following files for running the notebook
- train-jpg
- test-jpg
- test-jpg-additional
- csv
- csv
- csv
- I deleted the rest of the files as the device was running out of space, but if you have space you can keep it in a separate folder under data/planet.
Did I miss anything ? Any other tips ?