download_zenodo
allows to download archives attached to a Zenodo
record, identified by its DOI or concept DOI.
download_zenodo(
doi,
path = ".",
files = list(),
sandbox = FALSE,
logger = NULL,
quiet = FALSE,
...
)
a Zenodo DOI or concept DOI
the target directory where to download files
subset of filenames to restrain to download. If ignored, all files will be downloaded.
Use the sandbox infrastructure. Default is FALSE
a logger to print Zenodo API-related messages. The logger can be either NULL, "INFO" (with minimum logs), or "DEBUG" (for complete curl http calls logs)
Logical (FALSE
by default).
Do you want to suppress informative messages (not warnings)?
any other arguments for parallel downloading (more information at
ZenodoRecord, downloadFiles()
documentation)
# \dontrun{
#simple download (sequential)
download_zenodo("10.5281/zenodo.2547036")
#> ✔ Successfully fetched list of published records!
#> ! No record for DOI '10.5281/zenodo.2547036'!
#> ℹ Try to get deposition by Zenodo specific record id '2547036'
#> ✔ Successfully fetched list of published records!
#> ! No record for id '2547036'!
#> ℹ Successfully fetched list of published records - page 1
#> ✔ Successfully fetched list of published records!
#> ✔ Successfully fetched published record for concept DOI '10.5281/zenodo.2547036'!
#> ℹ Download in sequential mode
#> [zen4R][INFO] ZenodoRecord - Download in sequential mode
#> ℹ Will download 2 files from record '6656251' (doi: '10.5281/zenodo.6656251') - total size: 114.5 KiB
#> [zen4R][INFO] ZenodoRecord - Will download 2 files from record '6656251' (doi: '10.5281/zenodo.6656251') - total size: 114.5 KiB
#> ℹ Downloading file 'zen4R-0.6-1.tar.gz' - size: 50.4 KiB
#> [zen4R][INFO] Downloading file 'zen4R-0.6-1.tar.gz' - size: 50.4 KiB
#> ℹ Downloading file 'zen4R-0.6-1.zip' - size: 64 KiB
#> [zen4R][INFO] Downloading file 'zen4R-0.6-1.zip' - size: 64 KiB
#> ℹ Files downloaded at '/home/runner/work/zen4R/zen4R/docs/reference'.
#> [zen4R][INFO] Files downloaded at '/home/runner/work/zen4R/zen4R/docs/reference'.
#> ℹ Verifying file integrity...
#> [zen4R][INFO] ZenodoRecord - Verifying file integrity...
#> ℹ File 'zen4R-0.6-1.tar.gz': integrity verified (md5sum: a7cf6c5a9bda54867ea3bcab2a5dfdf9)
#> [zen4R][INFO] File 'zen4R-0.6-1.tar.gz': integrity verified (md5sum: a7cf6c5a9bda54867ea3bcab2a5dfdf9)
#> ℹ File 'zen4R-0.6-1.zip': integrity verified (md5sum: 0cd3611a83c51e9c23703bd27e1beb92)
#> [zen4R][INFO] File 'zen4R-0.6-1.zip': integrity verified (md5sum: 0cd3611a83c51e9c23703bd27e1beb92)
#> ✔ End of download
#> [zen4R][INFO] ZenodoRecord - End of download
library(parallel)
#download files as parallel using a cluster approach (for both Unix/Win systems)
download_zenodo("10.5281/zenodo.2547036",
parallel = TRUE, parallel_handler = parLapply, cl = makeCluster(2))
#> ✔ Successfully fetched list of published records!
#> ! No record for DOI '10.5281/zenodo.2547036'!
#> ℹ Try to get deposition by Zenodo specific record id '2547036'
#> ✔ Successfully fetched list of published records!
#> ! No record for id '2547036'!
#> ℹ Successfully fetched list of published records - page 1
#> ✔ Successfully fetched list of published records!
#> ✔ Successfully fetched published record for concept DOI '10.5281/zenodo.2547036'!
#> ℹ Download in parallel mode
#> [zen4R][INFO] ZenodoRecord - Download in parallel mode
#> ℹ Using cluster-based parallel handler (cluster 'cl' argument specified)
#> [zen4R][INFO] ZenodoRecord - Using cluster-based parallel handler (cluster 'cl' argument specified)
#> ℹ Will download 2 files from record '6656251' (doi: '10.5281/zenodo.6656251') - total size: 114.5 KiB
#> [zen4R][INFO] ZenodoRecord - Will download 2 files from record '6656251' (doi: '10.5281/zenodo.6656251') - total size: 114.5 KiB
#> ℹ Files downloaded at '/home/runner/work/zen4R/zen4R/docs/reference'.
#> [zen4R][INFO] Files downloaded at '/home/runner/work/zen4R/zen4R/docs/reference'.
#> ℹ Verifying file integrity...
#> [zen4R][INFO] ZenodoRecord - Verifying file integrity...
#> ℹ File 'zen4R-0.6-1.tar.gz': integrity verified (md5sum: a7cf6c5a9bda54867ea3bcab2a5dfdf9)
#> [zen4R][INFO] File 'zen4R-0.6-1.tar.gz': integrity verified (md5sum: a7cf6c5a9bda54867ea3bcab2a5dfdf9)
#> ℹ File 'zen4R-0.6-1.zip': integrity verified (md5sum: 0cd3611a83c51e9c23703bd27e1beb92)
#> [zen4R][INFO] File 'zen4R-0.6-1.zip': integrity verified (md5sum: 0cd3611a83c51e9c23703bd27e1beb92)
#> ✔ End of download
#> [zen4R][INFO] ZenodoRecord - End of download
#download files as parallel using mclapply (for Unix systems)
download_zenodo("10.5281/zenodo.2547036",
parallel = TRUE, parallel_handler = mclapply, mc.cores = 2)
#> ✔ Successfully fetched list of published records!
#> ! No record for DOI '10.5281/zenodo.2547036'!
#> ℹ Try to get deposition by Zenodo specific record id '2547036'
#> ✔ Successfully fetched list of published records!
#> ! No record for id '2547036'!
#> ℹ Successfully fetched list of published records - page 1
#> ✔ Successfully fetched list of published records!
#> ✔ Successfully fetched published record for concept DOI '10.5281/zenodo.2547036'!
#> ℹ Download in parallel mode
#> [zen4R][INFO] ZenodoRecord - Download in parallel mode
#> ℹ Using non cluster-based (no cluster 'cl' argument specified)
#> [zen4R][INFO] ZenodoRecord - Using non cluster-based (no cluster 'cl' argument specified)
#> ℹ Will download 2 files from record '6656251' (doi: '10.5281/zenodo.6656251') - total size: 114.5 KiB
#> [zen4R][INFO] ZenodoRecord - Will download 2 files from record '6656251' (doi: '10.5281/zenodo.6656251') - total size: 114.5 KiB
#> ℹ Files downloaded at '/home/runner/work/zen4R/zen4R/docs/reference'.
#> [zen4R][INFO] Files downloaded at '/home/runner/work/zen4R/zen4R/docs/reference'.
#> ℹ Verifying file integrity...
#> [zen4R][INFO] ZenodoRecord - Verifying file integrity...
#> ℹ File 'zen4R-0.6-1.tar.gz': integrity verified (md5sum: a7cf6c5a9bda54867ea3bcab2a5dfdf9)
#> [zen4R][INFO] File 'zen4R-0.6-1.tar.gz': integrity verified (md5sum: a7cf6c5a9bda54867ea3bcab2a5dfdf9)
#> ℹ File 'zen4R-0.6-1.zip': integrity verified (md5sum: 0cd3611a83c51e9c23703bd27e1beb92)
#> [zen4R][INFO] File 'zen4R-0.6-1.zip': integrity verified (md5sum: 0cd3611a83c51e9c23703bd27e1beb92)
#> ✔ End of download
#> [zen4R][INFO] ZenodoRecord - End of download
# }