How to use Kaggle Api in Google Colab for directly using dataset?
I know that we can use Kaggle's api directly in google colab which downloads the dataset. The commands are :
!mkdir .kaggle
!echo '{"username":"somename","key":"apikey"}' /root/.kaggle/kaggle.json
!chmod 600 /root/.kaggle/kaggle.json
!kaggle competitions download -c bluebook-for-bulldozers -p /content
But I need to do this process of making .kaggle file and pass the apikey in google colab gpu everytime. And sometimes the echo command run saying no file called .kaggle but after say 2 mins without restarting the kernal, it works. It sounds funny but yes this is true. Can't I just make a .kaggle file(only once) and use these commands just once and download the dataset just once and store it somewhere and use it even for later purposes. I have used google drive mount process but it's hectic and takes lot of time uploading the datasets in drive. It would also be ok if I need to download the dataset everytime using just this command rather than making .kaggle file and writing the api key and username every time in it:
!kaggle competitions download -c bluebook-for-bulldozers -p /content
The success rates of previous commands are pretty less in one go and wastes lot of time.