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,
  ...
)

Arguments

doi

a Zenodo DOI or concept DOI

path

the target directory where to download files

files

subset of filenames to restrain to download. If ignored, all files will be downloaded.

sandbox

Use the sandbox infrastructure. Default is FALSE

logger

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)

quiet

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)

Examples

# \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 
# }