universe

Tools for Working with R-universe and its APIs.

Installation and docs

You can install the development version of universe from r-universe:

install.packages("universe", repos = "https://ropensci.r-universe.dev")

Or the development version of universe from GitHub with:

# install.packages("pak")
pak::pak("ropensci/universe")

Documentation is available on https://docs.ropensci.org/universe.

Enable a repository

Use runiverse::add() to opt-in to a package repository (this will modify your options('repos') list).

# Install a package from r-universe
universe::add("ropensci")
install.packages("magick")

For more details see the documentation for runiverse::add().

Get data from the APIs

All packages in an universe

library(universe)
#> 
#> Attaching package: 'universe'
#> The following object is masked from 'package:base':
#> 
#>     remove
universe_ls("jeroen")
#>  [1] "RAppArmor" "V8"        "badgen"    "base64"    "bcrypt"    "brotli"   
#>  [7] "curl"      "gpg"       "js"        "jsonlite"  "maketools" "mongolite"
#> [13] "openssl"   "protolite" "rjade"     "sys"       "unix"      "webp"     
#> [19] "webutils"

Info on all packages in an universe

universe_all_packages("jeroen", limit = 1) |>
  str(max.level = 2)
#> List of 1
#>  $ :List of 76
#>   ..$ Package           : chr "openssl"
#>   ..$ Type              : chr "Package"
#>   ..$ Title             : chr "Toolkit for Encryption, Signatures and Certificates Based on\nOpenSSL"
#>   ..$ Version           : chr "2.3.0"
#>   ..$ Authors@R         : chr "c(person(\"Jeroen\", \"Ooms\", role = c(\"aut\", \"cre\"), email = \"[email protected]\",\ncomment = c(ORCID"| __truncated__
#>   ..$ Description       : chr "Bindings to OpenSSL libssl and libcrypto, plus custom SSH\nkey parsers. Supports RSA, DSA and EC curves P-256, "| __truncated__
#>   ..$ License           : chr "MIT + file LICENSE"
#>   ..$ URL               : chr "https://jeroen.r-universe.dev/openssl"
#>   ..$ BugReports        : chr "https://github.com/jeroen/openssl/issues"
#>   ..$ SystemRequirements: chr "OpenSSL >= 1.0.2"
#>   ..$ VignetteBuilder   : chr "knitr"
#>   ..$ RoxygenNote       : chr "7.3.2"
#>   ..$ Encoding          : chr "UTF-8"
#>   ..$ Roxygen           : chr "list(markdown = TRUE)"
#>   ..$ Config/pak/sysreqs: chr "libssl-dev"
#>   ..$ Repository        : chr "https://jeroen.r-universe.dev"
#>   ..$ RemoteUrl         : chr "https://github.com/jeroen/openssl"
#>   ..$ RemoteRef         : chr "HEAD"
#>   ..$ RemoteSha         : chr "597003e7aa95106cd34ff82c431e551a1e1e2978"
#>   ..$ NeedsCompilation  : chr "yes"
#>   ..$ Packaged          :List of 2
#>   ..$ Author            : chr "Jeroen Ooms [aut, cre] (<https://orcid.org/0000-0002-4035-0289>),\nOliver Keyes [ctb]"
#>   ..$ Maintainer        : chr "Jeroen Ooms <[email protected]>"
#>   ..$ MD5sum            : chr "9d7591c7946c8940cb349c6be596a01c"
#>   ..$ _user             : chr "jeroen"
#>   ..$ _type             : chr "src"
#>   ..$ _file             : chr "openssl_2.3.0.tar.gz"
#>   ..$ _fileid           : chr "85871dedbf550e8c2b7b0756c9f90f188dbce5339a51b6d36278ef35e48b79d9"
#>   ..$ _filesize         : int 502923
#>   ..$ _sha256           : chr "85871dedbf550e8c2b7b0756c9f90f188dbce5339a51b6d36278ef35e48b79d9"
#>   ..$ _created          : chr "2024-12-16T14:24:38.000Z"
#>   ..$ _published        : chr "2024-12-16T14:30:01.595Z"
#>   ..$ _upstream         : chr "https://github.com/jeroen/openssl"
#>   ..$ _commit           :List of 5
#>   ..$ _maintainer       :List of 8
#>   ..$ _distro           : chr "noble"
#>   ..$ _host             : chr "GitHub-Actions"
#>   ..$ _status           : chr "success"
#>   ..$ _pkgdocs          : chr "skipped"
#>   ..$ _winbinary        : chr "success"
#>   ..$ _macbinary        : chr "success"
#>   ..$ _wasmbinary       : chr "success"
#>   ..$ _linuxdevel       : chr "success"
#>   ..$ _windevel         : chr "success"
#>   ..$ _buildurl         : chr "https://github.com/r-universe/jeroen/actions/runs/12354605194"
#>   ..$ _registered       : logi TRUE
#>   ..$ _dependencies     :List of 9
#>   ..$ _owner            : chr "jeroen"
#>   ..$ _selfowned        : logi TRUE
#>   ..$ _usedby           : int 4897
#>   ..$ _updates          :List of 12
#>   ..$ _tags             :List of 1
#>   ..$ _stars            : int 65
#>   ..$ _contributions    :List of 12
#>   ..$ _userbio          :List of 4
#>   ..$ _downloads        :List of 2
#>   ..$ _mentions         : int 7
#>   ..$ _devurl           : chr "https://github.com/jeroen/openssl"
#>   ..$ _searchresults    : int 612
#>   ..$ _topics           :List of 1
#>   ..$ _assets           :List of 11
#>   ..$ _homeurl          : chr "https://github.com/jeroen/openssl"
#>   ..$ _realowner        : chr "jeroen"
#>   ..$ _cranurl          : logi TRUE
#>   ..$ _releases         :List of 45
#>   ..$ _exports          :List of 78
#>   ..$ _help             :List of 22
#>   ..$ _readme           : chr "https://github.com/jeroen/openssl/raw/HEAD/README.md"
#>   ..$ _rundeps          :List of 2
#>   ..$ _sysdeps          :List of 2
#>   ..$ _vignettes        :List of 4
#>   ..$ _score            : num 18
#>   ..$ _indexed          : logi TRUE
#>   ..$ _nocasepkg        : chr "openssl"
#>   ..$ _universes        :List of 1
#>   ..$ _binaries         :List of 11

Info on a single package in an universe

universe_one_package("jeroen", package = "curl") |>
  str(max.level = 1)
#> List of 77
#>  $ Package           : chr "curl"
#>  $ Type              : chr "Package"
#>  $ Title             : chr "A Modern and Flexible Web Client for R"
#>  $ Version           : chr "6.0.2"
#>  $ Authors@R         : chr "c(\nperson(\"Jeroen\", \"Ooms\", role = c(\"aut\", \"cre\"), email = \"[email protected]\",\ncomment = c(ORC"| __truncated__
#>  $ Description       : chr "Bindings to 'libcurl' <https://curl.se/libcurl/> for\nperforming fully configurable HTTP/FTP requests where res"| __truncated__
#>  $ License           : chr "MIT + file LICENSE"
#>  $ SystemRequirements: chr "libcurl (>= 7.62): libcurl-devel (rpm) or\nlibcurl4-openssl-dev (deb)"
#>  $ URL               : chr "https://jeroen.r-universe.dev/curl"
#>  $ BugReports        : chr "https://github.com/jeroen/curl/issues"
#>  $ VignetteBuilder   : chr "knitr"
#>  $ RoxygenNote       : chr "7.3.2.9000"
#>  $ Encoding          : chr "UTF-8"
#>  $ Language          : chr "en-US"
#>  $ Roxygen           : chr "list(markdown = TRUE)"
#>  $ Config/pak/sysreqs: chr "libssl-dev"
#>  $ Repository        : chr "https://jeroen.r-universe.dev"
#>  $ RemoteUrl         : chr "https://github.com/jeroen/curl"
#>  $ RemoteRef         : chr "HEAD"
#>  $ RemoteSha         : chr "0ae1b4417997ec463b6e94467d5cea7885d89ffa"
#>  $ NeedsCompilation  : chr "yes"
#>  $ Packaged          :List of 2
#>  $ Author            : chr "Jeroen Ooms [aut, cre] (<https://orcid.org/0000-0002-4035-0289>),\nHadley Wickham [ctb],\nPosit Software, PBC [cph]"
#>  $ Maintainer        : chr "Jeroen Ooms <[email protected]>"
#>  $ MD5sum            : chr "1ac26287b3842f0a3099f7f0d0d81959"
#>  $ _user             : chr "jeroen"
#>  $ _type             : chr "src"
#>  $ _file             : chr "curl_6.0.2.tar.gz"
#>  $ _fileid           : chr "661a84585f9630524123856115ea4f7ca8988d062fa43d4aab026a1492d7a165"
#>  $ _filesize         : int 534088
#>  $ _sha256           : chr "661a84585f9630524123856115ea4f7ca8988d062fa43d4aab026a1492d7a165"
#>  $ _created          : chr "2024-12-04T20:29:42.000Z"
#>  $ _published        : chr "2024-12-09T15:25:58.349Z"
#>  $ _upstream         : chr "https://github.com/jeroen/curl"
#>  $ _commit           :List of 5
#>  $ _maintainer       :List of 8
#>  $ _distro           : chr "noble"
#>  $ _host             : chr "GitHub-Actions"
#>  $ _status           : chr "success"
#>  $ _pkgdocs          : chr "skipped"
#>  $ _winbinary        : chr "success"
#>  $ _macbinary        : chr "success"
#>  $ _wasmbinary       : chr "none"
#>  $ _linuxdevel       : chr "success"
#>  $ _windevel         : chr "success"
#>  $ _buildurl         : chr "https://github.com/r-universe/jeroen/actions/runs/12167730387"
#>  $ _registered       : logi TRUE
#>  $ _dependencies     :List of 9
#>  $ _owner            : chr "jeroen"
#>  $ _selfowned        : logi TRUE
#>  $ _usedby           : int 5681
#>  $ _updates          :List of 18
#>  $ _tags             :List of 3
#>  $ _stars            : int 220
#>  $ _contributions    :List of 23
#>  $ _userbio          :List of 4
#>  $ _downloads        :List of 2
#>  $ _mentions         : int 21
#>  $ _devurl           : chr "https://github.com/jeroen/curl"
#>  $ _searchresults    : int 3808
#>  $ _topics           :List of 1
#>  $ _assets           :List of 11
#>  $ _homeurl          : chr "https://github.com/jeroen/curl"
#>  $ _realowner        : chr "jeroen"
#>  $ _cranurl          : logi TRUE
#>  $ _releases         :List of 48
#>  $ _exports          :List of 42
#>  $ _help             :List of 19
#>  $ _readme           : chr "https://github.com/jeroen/curl/raw/HEAD/README.md"
#>  $ _rundeps          : list()
#>  $ _sysdeps          :List of 1
#>  $ _vignettes        :List of 2
#>  $ _score            : num 19.8
#>  $ _indexed          : logi TRUE
#>  $ _nocasepkg        : chr "curl"
#>  $ _universes        :List of 1
#>  $ _binaries         :List of 9

Search within a single universe

universe_search("ropensci", query = 'needs:httr2', limit = 1) |>
  str(max.level = 2)
#> List of 5
#>  $ results:List of 1
#>   ..$ :List of 14
#>  $ query  :List of 2
#>   ..$ _universes: chr "ropensci"
#>   ..$ _rundeps  : chr "httr2"
#>  $ skip   : int 0
#>  $ limit  : int 1
#>  $ total  : int 31

Search among all universes

global_search(query = '"weather data"', limit = 1) |>
  str(max.level = 2)
#> List of 5
#>  $ results:List of 1
#>   ..$ :List of 15
#>  $ query  :List of 1
#>   ..$ $text:List of 2
#>  $ skip   : int 0
#>  $ limit  : int 1
#>  $ total  : int 74