Created
March 14, 2021 06:30
-
-
Save kashyapmanu/9e15e65389acb790fc3d19d5953ea283 to your computer and use it in GitHub Desktop.
Python code to download the files from google drive to kaggle
This file contains 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
# Install gdown | |
#! conda install -y gdown | |
#Run the above code if gdown is not installed. | |
""" | |
Get shareable link : - | |
https://drive.google.com/file/d/1-9XVOJSkXy0L894wAh5dC16MzL5Zt0Wk/view?usp=sharing | |
Add the file id's (1-9XVOJSkXy0L894wAh5dC16MzL5Zt0Wk) of the file to url list. | |
Name for your file | |
""" | |
url = ['1-9XVOJSkXy0L894wAh5dC16MzL5Zt0Wk'] | |
name=['train_feature'] | |
import gdown | |
#Crate a folder to store the files | |
!mkdir feature_trends | |
for i in range(len(url)): | |
output = "./feature_trends/"+name[i] | |
print('https://drive.google.com/uc?export=download&id='+url[i]) | |
gdown.download('https://drive.google.com/uc?export=download&id='+url[i], output, quiet=False) | |
""" | |
Credit : https://www.kaggle.com/rsinda/downloading-data-from-google-drive | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment