-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAcces kaggle API
More file actions
1 lines (1 loc) · 3.46 KB
/
Acces kaggle API
File metadata and controls
1 lines (1 loc) · 3.46 KB
1
{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"name":"kaggle API","provenance":[],"collapsed_sections":[],"mount_file_id":"1W5HrCvq08dAeD2pnRr7gZuVxLv3eI2Zg","authorship_tag":"ABX9TyP8Y1uj+iHL5OOohtpthkxa"},"kernelspec":{"name":"python3","display_name":"Python 3"}},"cells":[{"cell_type":"markdown","metadata":{"id":"0HZCsSY7vtmP"},"source":["Refer this [blog](https://medium.com/analytics-vidhya/how-to-fetch-kaggle-datasets-into-google-colab-ea682569851a)"]},{"cell_type":"code","metadata":{"id":"yavPWoSIU9yH","executionInfo":{"status":"ok","timestamp":1609766100513,"user_tz":-330,"elapsed":1347,"user":{"displayName":"Abdul Adhil P K","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14Gj969op7M8PYnLMjRj3-NrREfeM3s4D9iQ8UR1HDg=s64","userId":"16099653323688530409"}}},"source":["# Loading the Datasets\r\n","\r\n","import os\r\n","os.environ['KAGGLE_CONFIG_DIR'] = \"/content/drive/MyDrive/kaggle\""],"execution_count":1,"outputs":[]},{"cell_type":"code","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"dmE8uT7HU-eI","executionInfo":{"status":"ok","timestamp":1609766101212,"user_tz":-330,"elapsed":1439,"user":{"displayName":"Abdul Adhil P K","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14Gj969op7M8PYnLMjRj3-NrREfeM3s4D9iQ8UR1HDg=s64","userId":"16099653323688530409"}},"outputId":"8e959759-be88-4afb-9cfe-b418a08a38cb"},"source":["#changing the working directory\r\n","\r\n","%cd /content/drive/MyDrive/kaggle"],"execution_count":2,"outputs":[{"output_type":"stream","text":["/content/drive/MyDrive/kaggle\n"],"name":"stdout"}]},{"cell_type":"code","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"4Uibir0LVJdW","executionInfo":{"status":"ok","timestamp":1609766126861,"user_tz":-330,"elapsed":1169,"user":{"displayName":"Abdul Adhil P K","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14Gj969op7M8PYnLMjRj3-NrREfeM3s4D9iQ8UR1HDg=s64","userId":"16099653323688530409"}},"outputId":"1d0dfa12-2d18-47ec-fe88-a6b8720f3357"},"source":["!kaggle competitions download -c fake-news"],"execution_count":4,"outputs":[{"output_type":"stream","text":["Traceback (most recent call last):\n"," File \"/usr/local/bin/kaggle\", line 5, in <module>\n"," from kaggle.cli import main\n"," File \"/usr/local/lib/python2.7/dist-packages/kaggle/__init__.py\", line 23, in <module>\n"," api.authenticate()\n"," File \"/usr/local/lib/python2.7/dist-packages/kaggle/api/kaggle_api_extended.py\", line 149, in authenticate\n"," self._load_config(config_data)\n"," File \"/usr/local/lib/python2.7/dist-packages/kaggle/api/kaggle_api_extended.py\", line 190, in _load_config\n"," raise ValueError('Error: Missing %s in configuration.' % item)\n","ValueError: Error: Missing username in configuration.\n"],"name":"stdout"}]},{"cell_type":"code","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"0dAVfT9zV8rI","executionInfo":{"status":"ok","timestamp":1609752820459,"user_tz":-330,"elapsed":1729,"user":{"displayName":"Abdul Adhil P K","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14Gj969op7M8PYnLMjRj3-NrREfeM3s4D9iQ8UR1HDg=s64","userId":"16099653323688530409"}},"outputId":"e8308975-58f1-4c10-8027-abefd1fcf491"},"source":["!ls"],"execution_count":null,"outputs":[{"output_type":"stream","text":["kaggle.json submit.csv test.csv.zip train.csv.zip\n"],"name":"stdout"}]},{"cell_type":"code","metadata":{"id":"US1pzFcbWAGc"},"source":["#unzipping the zip files and deleting the zip files\r\n","\r\n","!unzip \\*.zip && rm *.zip"],"execution_count":null,"outputs":[]}]}