Installing Kaggle CLI and Competition Data Download

In the computer terminal enter the following commands to install the unofficial Kaggle CLI (Command Line Interface) and download competition files:

  1. pip install kaggle-cli
  2. kg config -u [Kaggle username] -p [Kaggle password]
  3. cd Documents/nbs/
  4. kg download -c [Kaggle competition name]

The purpose of each command:

  1. Installs the Kaggle CLI
  2. Sets the username and password for the Kaggle CLI. This is why the username and password parameters do not need defined in step 4.
  3. Change computer directory to the location where the competition files will be stored
  4. Downloads the competition files. IMPORTANT! before being able to download the competition files, the competition rules will need to be accepted. The accept option is at the end of the rules section of the competition on the Kaggle website

Example of installing Kaggle CLI and downloading Dogs vs. Cats competition files:

  1. pip install kaggle-cli
  2. kg config -u KaggleUser -p P@ssw0rd123
  3. cd Documents/nbs/
  4. kg download -c 'dogs-vs-cats'