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)
  }
}

Try the pleiades package in your browser

Any scripts or data that you put into this service are public.

pleiades documentation built on Oct. 23, 2020, 8:07 p.m.