Skip to content

Instantly share code, notes, and snippets.

@yasyaindra
Last active January 26, 2023 13:42
Show Gist options
  • Save yasyaindra/ddb0779d79ba148f1e6ce3aef1544eeb to your computer and use it in GitHub Desktop.
Save yasyaindra/ddb0779d79ba148f1e6ce3aef1544eeb to your computer and use it in GitHub Desktop.
downloading kaggle datasets directly to your google colab
!pip install opendatasets
import opendatasets as od
import pandas as pd
from google.colab import files
files.upload()
!ls -lha kaggle.json
!pip install -q kaggle # installing the kaggle package
!mkdir -p ~/.kaggle # creating .kaggle folder where the key should be placed
!cp kaggle.json ~/.kaggle/ # move the key to the folder
!pwd # checking the present working directory
!chmod 600 ~/.kaggle/kaggle.json
!kaggle datasets list
!kaggle datasets download -d datasets/name -p 'your_google_drive_path'
!unzip '/path/datasets.zip' -d '/path/datasets'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment