Specify repo, path, and github reference (master, sha, etc.) and get back an ls of that directory, including download links.

ls_github(repository, path = "", ref = "master")

Arguments

repository

character(1) formatted as 'user/repo_name' from Github

path

character(1) The path in the repo to ls on

ref

character(1) The github reference (tag, sha, branch) to run the ls on. Default is master.

Value

A tibble with columns including:

  • name

  • path

  • size

  • download_url

  • type (file or dir)

Examples

ls_github('TheEconomist/covid-19-excess-deaths-tracker',
          'output-data/excess-deaths')
#> # A tibble: 114 × 10
#>    name             path  sha     size url   html_url git_url download_url type 
#>    <chr>            <chr> <chr>  <int> <chr> <chr>    <chr>   <chr>        <chr>
#>  1 albania_excess_… outp… b6a0…   7145 http… https:/… https:… https://raw… file 
#>  2 algeria_excess_… outp… 3729…   3816 http… https:/… https:… https://raw… file 
#>  3 all_monthly_exc… outp… 674a… 377855 http… https:/… https:… https://raw… file 
#>  4 all_quarterly_e… outp… 6970…   2656 http… https:/… https:… https://raw… file 
#>  5 all_weekly_exce… outp… c378… 870318 http… https:/… https:… https://raw… file 
#>  6 andorra_excess_… outp… 6ba4…   3558 http… https:/… https:… https://raw… file 
#>  7 antigua_and_bar… outp… c019…   7194 http… https:/… https:… https://raw… file 
#>  8 argentina_exces… outp… 85e7…   3838 http… https:/… https:… https://raw… file 
#>  9 armenia_excess_… outp… 7b93…   7933 http… https:/… https:… https://raw… file 
#> 10 aruba_excess_de… outp… a10b…   6629 http… https:/… https:… https://raw… file 
#> # … with 104 more rows, and 1 more variable: `_links` <df[,3]>