Kaggle Plugin for Jupyter Notebook

When we want to work with various datasets, kaggle is one of the best places for finding the datasets. Sometimes it is easy to download the datasets directly from he kaggle and use it for data analysis.

But there are other ways also to get the dataset from kaggle. One of the options is using kaggle plugin. Below are the steps on how to install kaggle plugin in Jupyter Notebook.

   1. Execute below pip command in the jupyter notebook to install kaggle

   pip install kaggle --upgrade

   2. Navigate to https://www.kaggle.com and login to your account

   3. Navigate to Settings under account (or) use below link

   https://www.kaggle.com/settings

   4. Click on “Create new Token” under API section and this will download “kaggle.json” file.

   5. If you are using Windows, place the json file under below path:

   C:\Users\<Windows-username>\.kaggle\kaggle.json

         if you are using docker, please place this file under (root)

   ~/.kaggle/kaggle.json

         Use below commands to copy kaggle.json

   cp kaggle.json ~/.kaggle

   6. Use below import command in Jupyter notebook

   import kaggle

   7. Use below command to download the files under the current directory:

   !kaggle competitions download -c <path-of-competition>

Please share your feedback through comments.

Thank you !!

Leave a Comment

Your email address will not be published. Required fields are marked *