Automatic download of freely available Springer books during COVID-19 quarentine

Recently Springer has made available for free a collection of key textbooks so that educators, students and academics could use them during the COVID-19 quarentine. There are more than 500 textbooks on different disciplines and in English and German languages. The detailed list of textbooks can be found here.

Thinking about facilitating the access to this textbooks collection the project springerQuarantineBooksR, written in R, has been developed to download all of them automatically. Here I’ll describe here a step-by-step procedure to download, install and use the project’s package.

[EDIT] As a reader mentioned, the generate_springer_book_files() function shown below has been modified to download_springer_book_files(), because the project has evolved, changing the function’s name. But the idea behind downloading all books or just a set of books from Springer remains the same.

Step-by-step procedure

1. First you need to have the R environment installed:

$ sudo apt install r-base

2. I’m using Ubuntu 18.04, so in order for you to download the springerQuarantineBooksR package you need first another package called devtools. Devtools has some dependencies that we need to download:

$ sudo apt install build-essential libcurl4-gnutls-dev libxml2-dev libssl-dev

3. With the R environment set and dependencies installed we can access the R environment:

$ sudo -i R
>

4. Now it’s time to download the devtools package:

> install.packages("devtools")

5. Devtools maked available a function to download and install github repositories to our own R environment. Using the install_github() function, it’s possible to download and install the springerQuarantineBooksR package:

> devtools::install_github("renanxcortes/springerQuarantineBooksR")

6. After installing the package we need to load the package’s functions:

> library(springerQuarantineBooksR)

7. Finally we have to set the download folder and start downloading the textbook’s pdfs. You’ll need 7.27GB for the generated repositority.

> setwd("path-to-download-folder")
> tic("Total time: ")
> generate_springer_book_files()
> toc()

Alternative procedure to download specific books

The procedure detailed above generates a folder with 20 subfolders, one for each of the disciplines the books encompass. Alternatively you can download just specific books. In order to do that, access this URL and download the “Free English textbook titles (all disciplines)” spreadsheet.

Open the spreadsheet and select the rows of books you want to download, delete the rest. As an example, I ordered the books by the column “English Package Name” and selected just the Computer Science books, deleting the other, leaving only 48 rows.

Spreadsheet with just “Computer Science” books. Got 48 in total.

With the spreadsheet set, follow the steps below to download this book selection:

1. Enter the R environment, load the springerQuarantineBooksR package and define the path to the download folder:

$ sudo -i R
> library(springerQuarantineBooksR)
> setwd("path-to-download-folder")

2. Set a springer_table variable with the spreadsheet contents:

> springer_table <- read_excel("path-to-spreadsheet.xlsx")

3. Start to download the files:

> generate_springer_book_files(springer_table=springer_table)
Computer Science books from Springer

Enjoy and happy reading!

Other interesting topics:

  1. Devtools: https://github.com/r-lib/devtools
  2. How to Install R Packages using devtools on Ubuntu 18.04: https://www.digitalocean.com/community/tutorials/how-to-install-r-packages-using-devtools-on-ubuntu-18-04
  3. springerQuarantineBooksR project: https://github.com/renanxcortes/springerQuarantineBooksR