R/zzz.R

Defines functions check4sqlite pl_cache_path pl_base pl_GET

pl_GET <- function(url, ...) {
  cli <- crul::HttpClient$new(url = url)
  res <- cli$get(...)
  res$raise_for_status()
  res$parse("UTF-8")
}

pl_base <- function() 'https://pleiades.stoa.org/api'

pl_cache_path <- function() rappdirs::user_cache_dir("pleiades")

check4sqlite <- function() {
  if (!requireNamespace("RSQLite", quietly = TRUE)) {
    stop("Please install 'RSQLite'", call. = FALSE)
  } else {
    invisible(TRUE)
  }
}
ropensci/pleiades documentation built on May 18, 2022, 5:40 p.m.