Download Public Domain Works from Wikisource

Download public domain works from Wikisource <>, a free library from the Wikimedia Foundation project.

The wikisourcer R package helps you download public domain works from the free library Wikisource.

It includes two functions for downloading books and pages by url.

  • wikisource_book() to download a book
  • wikisource_page() to download a page


install.packages("wikisourcer") # install release version from CRAN
devtools::install_github("lgnbhl/wikisourcer") # install development version from GitHub

Minimal examples

Download Voltaire’s philosophical novel Candide.


Download Voltaire’s Candide books in French, Spanish and Italian.

fr <- ",_ou_l%E2%80%99Optimisme/Garnier_1877"
es <- ",_o_el_optimismo"
it <- ""
purrr::map_df(c(fr, es, it), wikisource_book)

Download Sonnet 18 of William Shakespeare.

wikisource_page("", "Sonnet 18")

Download 154 Sonnets of William Shakespeare.

urls <- paste0("", 1:154, "_(Shakespeare)") #154 urls
purrr::map2_df(urls, paste0("Sonnet ", 1:154), wikisource_page)

For more information on how to use wikisourcer, please read the vignette.


Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.1.2 by Félix Luginbuhl, 2 months ago

Report a bug at

Browse source code at

Authors: Félix Luginbuhl [aut, cre]

Documentation:   PDF Manual  

MIT + file LICENSE license

Imports dplyr, rvest, stringr, purrr, xml2, urltools

Suggests knitr, rmarkdown, ggplot2, tidyr, tidytext, widyr, SnowballC, ggraph, igraph

See at CRAN