Skip to content

Instantly share code, notes, and snippets.

@BlazerYoo
Last active June 28, 2021 20:21
Show Gist options
  • Save BlazerYoo/01daf8788cd8682827e18a426b398225 to your computer and use it in GitHub Desktop.
Save BlazerYoo/01daf8788cd8682827e18a426b398225 to your computer and use it in GitHub Desktop.
Download Kaggle data to Google Drive with authentication pipeline
# run `python kaggle.py`
from google.colab import drive
drive.mount('/content/gdrive')
import os, json
os.system('mkdir ~/.kaggle;touch ~/.kaggle/kaggle.json')
api_token = {"username":"username","key":"api_key"}
with open('/root/.kaggle/kaggle.json', 'w') as f:
json.dump(api_token, f)
os.system('chmod 600 ~/.kaggle/kaggle.json')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment