Created
April 14, 2020 00:40
-
-
Save rameshkrishna/71b69cbc07490b7c73d681b3380663af to your computer and use it in GitHub Desktop.
Download Kaggle Datasets in Notebook / Google Colab / Azure Notebook / Jupyter notebook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"nbformat": 4, | |
"nbformat_minor": 0, | |
"metadata": { | |
"colab": { | |
"name": "kaggleDatasetsDL.ipynb", | |
"provenance": [] | |
}, | |
"kernelspec": { | |
"name": "python3", | |
"display_name": "Python 3" | |
} | |
}, | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"metadata": { | |
"id": "KpEmuwJBHpZ_", | |
"colab_type": "code", | |
"colab": {} | |
}, | |
"source": [ | |
"!pip install kaggle\n", | |
"\n", | |
"#Set the enviroment variables\n", | |
"import os\n", | |
"os.environ['KAGGLE_USERNAME'] = \"xxxxxx\"\n", | |
"os.environ['KAGGLE_KEY'] = \"xxxxxxxxxxxxxxxxxxxxxxxxx\"" | |
], | |
"execution_count": 0, | |
"outputs": [] | |
}, | |
{ | |
"cell_type": "code", | |
"metadata": { | |
"id": "NHbnfLPAHroD", | |
"colab_type": "code", | |
"colab": {} | |
}, | |
"source": [ | |
"!kaggle datasets list" | |
], | |
"execution_count": 0, | |
"outputs": [] | |
}, | |
{ | |
"cell_type": "code", | |
"metadata": { | |
"id": "5PFpc8osHvNB", | |
"colab_type": "code", | |
"colab": {} | |
}, | |
"source": [ | |
"!kaggle datasets download sobhanmoosavi/us-accidents\n", | |
"\n", | |
"#Extract the zip file\n", | |
"!unzip us-accidents.zip\n" | |
], | |
"execution_count": 0, | |
"outputs": [] | |
}, | |
{ | |
"cell_type": "code", | |
"metadata": { | |
"id": "WnVmLHaXH8pi", | |
"colab_type": "code", | |
"colab": {} | |
}, | |
"source": [ | |
"##another way\n", | |
"!mkdir /root/.kaggle\n", | |
"!echo '{\"username\":\"xxxxxx\",\"key\":\"xxxxxxxxxxxxxxxxx\"}' > /root/.kaggle/kaggle.json" | |
], | |
"execution_count": 0, | |
"outputs": [] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment