Skip to content
Snippets Groups Projects
Commit 0a1f135c authored by elodie.fernandez_ird.fr's avatar elodie.fernandez_ird.fr
Browse files

New notebook: download from google drive

parent b5f1b232
No related branches found
No related tags found
No related merge requests found
%% Cell type:markdown id:8c0db7e6 tags:
%% Cell type:markdown id:99265242 tags:
# Télécharger des données de Google Drive
%% Cell type:markdown id:245854eb tags:
%% Cell type:markdown id:d7fae604 tags:
Télécharger en local l'intégralité d'un répertoire Google Drive.
Pour pouvoir télécharger aisément, il faut avant toute chose partager le répertoire en question. Pour cela,
aller sur Google Drive, faire un clic droit sur le répertoire en question et faire "get link". Changer le "general
access" pour "Anyone with the link". Puis Done.
%% Cell type:code id:b8591b7e tags:
%% Cell type:code id:58ec3c5e tags:
``` python
import gdown
import pathlib
```
%% Cell type:code id:60f74ad2 tags:
%% Cell type:code id:2b189ee7 tags:
``` python
# URL vers le dossier google drive à télécharger
url = "https://drive.google.com/drive/folders/1qMs_vrybdW6UQWUrv8SFj-hg3bEsNH8G"
```
%% Cell type:code id:b2ea2fa4 tags:
%% Cell type:code id:58db078d tags:
``` python
# Répertoire en local où déposer les données téléchargées
# Le contenu du répertoire Google Drive sera déposé directement dans ce répertoire,
# il n'y aura pas de sous-dossier du nom du répertoire Google Drive
outdir = pathlib.Path("/home/elodie/Data/PML/mes_donnees_drive")
```
%% Cell type:code id:d5b3ea1f tags:
%% Cell type:code id:a22799f3 tags:
``` python
# Téléchargement
# quiet=False pour suivre l'évolution du téléchargement
gdown.download_folder(url, output=str(outdir), quiet=False)
```
%% Output
Retrieving folder list
Processing file 1oxR6skLMW4ShONQF6-aiuJf0KzCGA7r0 2000-02-26_epsg4326_V2_v017.tif
Processing file 1GNQnluomzTI5oAu3NnYbiA6IMDE-Vavl 2000-02-26_epsg4326_V2_v017.tif
Processing file 1153w8RCqyicIgiVByVYPU32oO15b_QMR 2000-03-05_epsg4326_V2_v017.tif
Building directory structure completed
Retrieving folder list completed
Building directory structure
Downloading...
From: https://drive.google.com/uc?id=1oxR6skLMW4ShONQF6-aiuJf0KzCGA7r0
To: /home/elodie/Data/PML/mes_donnees_drive/2000-02-26_epsg4326_V2_v017.tif
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 84.2M/84.2M [00:01<00:00, 57.7MB/s]
Downloading...
From: https://drive.google.com/uc?id=1GNQnluomzTI5oAu3NnYbiA6IMDE-Vavl
To: /home/elodie/Data/PML/mes_donnees_drive/2000-02-26_epsg4326_V2_v017.tif
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 84.2M/84.2M [00:01<00:00, 67.8MB/s]
Downloading...
From: https://drive.google.com/uc?id=1153w8RCqyicIgiVByVYPU32oO15b_QMR
To: /home/elodie/Data/PML/mes_donnees_drive/2000-03-05_epsg4326_V2_v017.tif
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 79.1M/79.1M [00:01<00:00, 62.3MB/s]
Download completed
['/home/elodie/Data/PML/mes_donnees_drive/2000-02-26_epsg4326_V2_v017.tif',
'/home/elodie/Data/PML/mes_donnees_drive/2000-02-26_epsg4326_V2_v017.tif',
'/home/elodie/Data/PML/mes_donnees_drive/2000-03-05_epsg4326_V2_v017.tif']
%% Cell type:code id:24053b2a tags:
%% Cell type:code id:09a0afe1 tags:
``` python
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment