| Title: | A Wrap Around the 'DistillerSR' APIs |
|---|---|
| Description: | Interface to 'DistillerSR' APIs. See <https://apidocs.evidencepartners.com/> for more details. |
| Authors: | Lorenzo Copelli [aut] (ORCID: <https://orcid.org/0009-0002-4305-065X>), Fulvio Barizzone [aut] (ORCID: <https://orcid.org/0009-0006-3035-520X>), Dayana Stephanie Buzle [aut] (ORCID: <https://orcid.org/0009-0003-2990-7431>), Rafael Vieira [aut] (ORCID: <https://orcid.org/0009-0009-0289-5438>), Luca Belmonte [aut, cre] (ORCID: <https://orcid.org/0000-0002-7977-9170>) |
| Maintainer: | Luca Belmonte <[email protected]> |
| License: | EUPL-1.2 |
| Version: | 1.0.0 |
| Built: | 2026-05-25 06:04:23 UTC |
| Source: | https://github.com/openefsa/distiller |
Authenticates a user to a DistillerSR instance using a personal access key. The function returns a valid authentication token that can be used to access protected DistillerSR API endpoints.
getAuthenticationToken( distillerInstanceUrl = Sys.getenv("DISTILLER_INSTANCE_URL"), distillerKey = Sys.getenv("DISTILLER_API_KEY"), timeout = 1800 )getAuthenticationToken( distillerInstanceUrl = Sys.getenv("DISTILLER_INSTANCE_URL"), distillerKey = Sys.getenv("DISTILLER_API_KEY"), timeout = 1800 )
distillerInstanceUrl |
By default: Sys.getenv("DISTILLER_INSTANCE_URL"). |
distillerKey |
By default: Sys.getenv("DISTILLER_API_KEY"). |
timeout |
By default: 1800 seconds (30 minutes). |
By default, the personal access key and the instance URL are read from the
environment variables DISTILLER_API_KEY and DISTILLER_INSTANCE_URL.
A string containing a valid DistillerSR authentication token.
## Not run: # If 'DISTILLER_INSTANCE_URL' and 'DISTILLER_API_KEY' are defined in your # environment (e.g. .Renviron). distillerToken_ <- getAuthenticationToken() # If 'distillerInstanceUrl' and 'distillerKey' are to be specified manually. distillerToken_ <- getAuthenticationToken( distillerInstanceUrl = "https://url.to.distiller.instance", distillerKey = "YOUR_API_KEY") ## End(Not run)## Not run: # If 'DISTILLER_INSTANCE_URL' and 'DISTILLER_API_KEY' are defined in your # environment (e.g. .Renviron). distillerToken_ <- getAuthenticationToken() # If 'distillerInstanceUrl' and 'distillerKey' are to be specified manually. distillerToken_ <- getAuthenticationToken( distillerInstanceUrl = "https://url.to.distiller.instance", distillerKey = "YOUR_API_KEY") ## End(Not run)
This function queries the DistillerSR API to retrieve the list of projects accessible to the authenticated user. It requires an authentication token and a valid API instance URL. The result is a dataframe listing available projects.
getProjects( distillerInstanceUrl = Sys.getenv("DISTILLER_INSTANCE_URL"), distillerToken, timeout = 1800 )getProjects( distillerInstanceUrl = Sys.getenv("DISTILLER_INSTANCE_URL"), distillerToken, timeout = 1800 )
distillerInstanceUrl |
By default: Sys.getenv("DISTILLER_INSTANCE_URL"). |
distillerToken |
|
timeout |
By default: 1800 seconds (30 minutes). |
A tibble with four columns:
id: The project ID.
name: The name of the project.
de_project_id.
is_hidden.
## Not run: distillerToken_ <- getAuthenticationToken() projects_ <- getProjects(distillerToken = distillerToken_) ## End(Not run)## Not run: distillerToken_ <- getAuthenticationToken() projects_ <- getProjects(distillerToken = distillerToken_) ## End(Not run)
This function queries the DistillerSR API to retrieve a saved report associated with a given project ID. It requires user authentication and a valid API endpoint URL. The result is a dataframe containing metadata about the saved report.
getReport( projectId, reportId, format = c("excel", "csv"), distillerInstanceUrl = Sys.getenv("DISTILLER_INSTANCE_URL"), distillerToken, timeout = 1800, attempts = 1, retryEach = 600, verbose = TRUE )getReport( projectId, reportId, format = c("excel", "csv"), distillerInstanceUrl = Sys.getenv("DISTILLER_INSTANCE_URL"), distillerToken, timeout = 1800, attempts = 1, retryEach = 600, verbose = TRUE )
projectId |
|
reportId |
|
format |
|
distillerInstanceUrl |
By default: Sys.getenv("DISTILLER_INSTANCE_URL"). |
distillerToken |
|
timeout |
By default: 1800 seconds (30 minutes). |
attempts |
By default: 1 attempt. |
retryEach |
By default: 600 seconds (10 minutes). |
verbose |
By default: TRUE. |
A data frame containing the Distiller report as designed within DistillerSR.
## Not run: distillerToken_ <- getAuthenticationToken() projects_ <- getProjects(distillerToken = distillerToken_) reports_ <- getReports( projectId = projects_$id[1], distillerToken = distillerToken_) report_ <- getReport( projectId = projects_$id[1], reportID = reports_$id[7], format = "csv", distillerToken = distillerToken_) ## End(Not run)## Not run: distillerToken_ <- getAuthenticationToken() projects_ <- getProjects(distillerToken = distillerToken_) reports_ <- getReports( projectId = projects_$id[1], distillerToken = distillerToken_) report_ <- getReport( projectId = projects_$id[1], reportID = reports_$id[7], format = "csv", distillerToken = distillerToken_) ## End(Not run)
This function queries the DistillerSR API to retrieve the list of saved reports associated with a given project ID. It requires user authentication and a valid API endpoint URL. The result is a dataframe containing metadata about each saved report.
getReports( projectId, distillerInstanceUrl = Sys.getenv("DISTILLER_INSTANCE_URL"), distillerToken, timeout = 1800 )getReports( projectId, distillerInstanceUrl = Sys.getenv("DISTILLER_INSTANCE_URL"), distillerToken, timeout = 1800 )
projectId |
|
distillerInstanceUrl |
By default: Sys.getenv("DISTILLER_INSTANCE_URL"). |
distillerToken |
|
timeout |
By default: 1800 seconds (30 minutes). |
A tibble with four columns:
id: The ID of the saved report.
name: The name of the report.
date: The creation date of the report.
view: The format of the report (e.g., html, csv, excel).
## Not run: distillerToken_ <- getAuthenticationToken() projects_ <- getProjects(distillerToken = distillerToken_) reports_ <- getReports( projectId = projects_$id[1], distillerToken = distillerToken_) ## End(Not run)## Not run: distillerToken_ <- getAuthenticationToken() projects_ <- getProjects(distillerToken = distillerToken_) reports_ <- getReports( projectId = projects_$id[1], distillerToken = distillerToken_) ## End(Not run)