[PYTHON] Until you use the Kaggle API with Colab

Introduction

There were various articles, but This method worked so I hope it helps someone if I have a memorandum.

Who is it for?

Someone (I) who has touched Colab but isn't familiar with Kaggle yet.

procedure

--Getting Kaggle's API key --Upload to Colab --Command execution in Colab

Get Kaggle API key

  1. Register with Kaggle: You can register with your Google account
  2. Go to My Account: Tap the icon in the upper right to go to the modal menu
  3. Create API key: At the bottom of the My Account page, there is a cell called "API" and a button called "Create New API Token", so click it → kaggle.json will be downloaded.

Upload to Colab

  1. Open the Colab file appropriately
  2. Upload the file in the left pane or drag and drop to upload kaggle.json
  3. You should see kaggle.json in the left pane (should)

Command execution in Colab

Execute the following command.

!mkdir ~/.kaggle
!cp /content/kaggle.json ~/.kaggle/kaggle.json
!chmod 600 ~/.kaggle/kaggle.json

The following is a command to check if the file has been moved. If you hit this and `` `kaggle.json``` comes out, you almost win.

!ls ~/.kaggle

Below is a command to check if it is enabled. If you hit this and a list of various files appears, you win.

!kaggle competitions list

in conclusion

This method that is often introduced is just for uploading kaggle.json anywhere on Google Drive. I'm looking for various things so that it's okay (I felt like), so I said "I should specify the place to upload properly in my heart", so I will adopt the form I wrote here I decided to.

I left it to the momentum and wrote it roughly, so please point out anything!

Recommended Posts

Until you use the Kaggle API with Colab
Until you can use the Google Speech API
Note until you use emacs with WSL
Until you can use opencv with python
Use the Kaggle API inside a Docker container
Until you use PhantomJS with Python on Heroku
Use Twitter API with Python
Call the API with python3.
Use subsonic API with python3
You cannot use break or continue with the ternary operator
Until you start Jupyter with Docker
Use the preview feature with aws-cli
Specifying the date with the Twitter API
Hit the Etherpad-lite API with Python
Use the Flickr API from Python
Until you use Google cola boratory
Until you run python with apache
Until you shake ruby with renpy
Get the number of PVs of Qiita articles you posted with API
[September 2020 version] Explains the procedure to use Gmail API with Python
Until you try the Google Cloud Vision API (harmful image detection)
The strongest way to use MeCab and CaboCha with Google Colab
Until you build the environment with ABCI and run MaskTrack RCNN
Use MeCab and neologd with Google Colab
Access the Docker Remote API with Requests
[Introduction to machine learning] Until you run the sample code with chainer
Until you can read the error log
What you can do with API vol.1
Until you confirm iOS communication with mitmproxy
Check the correlation with Kaggle's Titanic (kaggle③)
Get holidays with the Google Calendar API
Play with puns using the COTOHA API
Until you try to let DNN learn the truth of the image using Colab
Until you CI what you made with Django with Jenkins
Tweet regularly with the Go language Twitter API
Identify the platform running Python (Kaggle / Colab / Windows)
Use the MediaWiki API to get Wiki information
Can you challenge Kaggle with just your iPad?
Specify the Python executable to use with virtualenv
Use logger with Python for the time being
Until you run the changefinder sample in python
How to use the Google Cloud Translation API
How to use the NHK program guide API
The easiest way to use OpenCV with python
Use JIRA API
Until you can install blender and run it with python for the time being
Play with the power usage API provided by Yahoo
Complement the library you put in anaconda with jedi-vim
Hit the Twitter API after Oauth authentication with Django
Let's use the API of the official statistics counter (e-Stat)
You can read the analog meter with the example MNIST.
Use the Cognitive Took Kit (CNTK) with the Keras backend
[Boto3] Search for Cognito users with the List Users API
Until you install Gauge and run the official sample
Let's use the Python version of the Confluence API module.
Create a tweet heatmap with the Google Maps API
Get comments and subscribers with the YouTube Data API
Specify MinGW as the compiler to use with Python
How to analyze with Google Colaboratory using Kaggle API
You can read the analog meter with the example MNIST.
[GitHub] Until you pull with ssh using Deploy keys