Python Forum
how to import files in Google Collab wihout downloading them to PC and to Google Disk - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: how to import files in Google Collab wihout downloading them to PC and to Google Disk (/thread-27271.html)



how to import files in Google Collab wihout downloading them to PC and to Google Disk - sveto4ka - Jun-01-2020

How can I import files in Google Collab wihout downloading them to PC and to Google Disk?
There is data on kaggle.com and there is my notebook on Google collab. How can I import files using only website link?
I don`t want to use space for a huge amount of data in Google disk and my PC


RE: how to import files in Google Collab wihout downloading them to PC and to Google Disk - pyzyx3qwerty - Jun-01-2020

What have you tried? Post your code in full input/output/error blocks - see BBCode to know more


RE: how to import files in Google Collab wihout downloading them to PC and to Google Disk - sveto4ka - Jun-01-2020

I tried nothing as my question is how to do this: I am asking for code


RE: how to import files in Google Collab wihout downloading them to PC and to Google Disk - snippsat - Jun-01-2020

Look this these links
4) Kaggle API in Colab
Easiest way to download kaggle data in Google Colab
Easy way to use Kaggle datasets in Google Colab


RE: how to import files in Google Collab wihout downloading them to PC and to Google Disk - sveto4ka - Jun-01-2020

Thanks! I saw similar recomendations. Unfortunately their code results in downloading files to Google drive. I want to use only links to web sites, without downloading


RE: how to import files in Google Collab wihout downloading them to PC and to Google Disk - jefsummers - Jun-01-2020

They don't make it easy, and may not be quite possible. However, you can create a notebook on the Kaggle site using their notebook platform and access tables that way. From what I could see you could save up to 5 Gb of temp info in your account there as well for intermediate results. So, maybe not using colab, but using something similar


RE: how to import files in Google Collab wihout downloading them to PC and to Google Disk - sveto4ka - Jun-01-2020

Thank you for your answer! I need 110 Gb(


RE: how to import files in Google Collab wihout downloading them to PC and to Google Disk - hussainmujtaba - Jun-02-2020

You can import a dataset from Kaggle to the colab without downloading it on the Pc and with impressive high speed. Follow the steps below:
1. Goto the Kaggle account and generate a token. You can see a kaggle.json file downloaded.
2.Mount your hard disk
3.upload the kaggle.json file.
4.Next type this and run in a cell
!pip install -q kaggle

5.Next run this code,and only once
! mkdir ~/.kaggle
! cp kaggle.json ~/.kaggle/
6.Now download using this command.I am going to paste an example with the code
!kaggle [i]datasets[/i] download -d [i]alessiocorrado99/animals10[/i]
Note that the text written in italic can be different for you.Here i am downloading a dataset from dataset section by using the API command which you can get from the kaggle.It can be like this too
! kaggle competitions download -c 'name-of-competition'



RE: how to import files in Google Collab wihout downloading them to PC and to Google Disk - jefsummers - Jun-02-2020

That looks like it downloads the files to the Google drive, which he is trying to avoid. I believe he is trying to access the files in place without having to use local or cloud storage. Correct me if wrong.


RE: how to import files in Google Collab wihout downloading them to PC and to Google Disk - sveto4ka - Jun-03-2020

Yes, jefsummers is right. This will result in downloading.
Also, the last way is better, in my opinion, as for my competion I was not be able to find dataset in the list of datasets. But dataset was attached to competion

However I still hope to find way without downloading