-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.qmd
63 lines (47 loc) · 1.41 KB
/
README.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
title: "**{laminr.api}**: R Interface to the LaminDB API"
format: gfm
---
## Overview
The **{laminr.api}** package provides an low-level R interface to the LaminDB API. The package is not meant to be used directly by end-users, but is used by higher-level packages like **{laminr}**.
This package is mostly auto-generated from the OpenAPI specification of the LaminDB API using the [OpenAPI Generator](https://www.npmjs.com/package/@openapitools/openapi-generator-cli).
## Installation
To install directly from Github, use `remotes`:
```R
if (!requireNamespace("remotes", quietly=TRUE)) {
install.packages("remotes")
}
remotes::install_github("data-intuitive/laminr.api")
```
### Usage
```{r}
library(laminr.api)
# retrieve these values from ~/.lamin/current_instance.env
# after running `lamin connect <instance_id>`
api_url <- "https://us-east-1.api.lamin.ai/"
instance_id <- "037ba1e08d804f91a90275a47735076a"
schema_id <- "097186c3e91c01ced47aa3e01a3c1515"
api_client <- ApiClient$new(base_path = api_url)
api <- DefaultApi$new(api_client = api_client)
```
Show API object:
```{r}
api
```
Get schema:
```{r}
schema <- api$GetSchemaInstancesInstanceIdSchemaGet(instance_id)
names(schema)
names(schema$core)
```
Get record:
```{r}
api$GetRecordInstancesInstanceIdModulesModuleNameModelNameIdOrUidPost(
instance_id,
"core",
"artifact",
"3TNCsZZcnIBv2WGb0001",
schema_id,
include_foreign_keys = TRUE
)
```