1Create api key
2and yout colab:
3
4from google.colab import files
5files.upload() #upload kaggle.json
6
7!pip install --upgrade --force-reinstall --no-deps kaggle
8!mkdir -p ~/.kaggle
9!cp kaggle.json ~/.kaggle/
10!ls ~/.kaggle
11!chmod 600 /root/.kaggle/kaggle.json
12!kaggle competitions -h
13!kaggle competitions download -c DATASET
1def pull_kaggle_data(username,key):
2import json
3! mkdir .kaggle
4token = {"username":username,"key":username}
5with open(".kaggle/kaggle.json", "w") as file:
6json.dump(token, file)
7! cp .kaggle/kaggle.json ~/.kaggle/kaggle.json
8
9
10================================================================================
11pull_kaggle_data(username,key)
12! kaggle competitions download -c malware-classification