| lamin_cli | R Documentation |
Lamin CLI calls are available from R by importing the lamin_cli Python
module using lc <- import_module("lamin_cli"). The previous CLI functions
are now deprecated, see examples for how to switch to the new syntax.
# Import the module instead of using deprecated functions
# lc <- import_module("lamin_cli")
# Deprecated functions
lamin_connect(instance)
lamin_disconnect()
lamin_login(user = NULL, api_key = NULL)
lamin_logout()
lamin_init(storage, name = NULL, db = NULL, modules = NULL)
lamin_init_temp(
name = "laminr-temp",
db = NULL,
modules = NULL,
add_timestamp = TRUE,
envir = parent.frame()
)
lamin_delete(instance, force = FALSE)
lamin_save(filepath, key = NULL, description = NULL, registry = NULL)
lamin_settings()
instance |
Either a slug giving the instance to connect to
( |
user |
Handle for the user to login as |
api_key |
API key for a user |
storage |
A local directory, AWS S3 bucket or Google Cloud Storage bucket |
name |
A name for the instance |
db |
A Postgres database connection URL, use |
modules |
A vector of modules to include (e.g. "bionty") |
add_timestamp |
Whether to append a timestamp to |
envir |
An environment passed to |
force |
Whether to force deletion without asking for confirmation |
filepath |
Path to the file or folder to save |
key |
The key for the saved item |
description |
The description for the saved item |
registry |
The registry for the saved item |
lamin_connect()Running this will set the LaminDB auto-connect option to True so you
auto-connect to instance when importing Python lamindb.
lamin_login()Depending on the input, one of these commands will be run (in this order):
If user is set then lamin login <user>
Else if api_key is set then set the LAMIN_API_KEY environment variable
temporarily with withr::with_envvar() and run lamin login
Else if there is a stored user handle run lamin login <handle>
Else if the LAMIN_API_KEY environment variable is set run lamin login
Otherwise, exit with an error
lamin_init_temp()For lamin_init_temp(), a time stamp is appended to name (if
add_timestamp = TRUE) and then a new instance is initialised with
lamin_init() using a temporary directory. A lamin_delete() call is
registered as an exit handler with withr::defer() to clean up the instance
when envir finishes.
The lamin_init_temp() function is mostly for internal use and in most cases
users will want lamin_init().
## Not run:
# Import Lamin modules
lc <- import_module("lamin_cli")
ln <- import_module("lamindb")
# Examples of replacing CLI functions with the lamin_cli module
## End(Not run)
## Not run:
# Connect to a LaminDB instance
lamin_connect(instance)
# ->
lc$connect(instance)
## End(Not run)
## Not run:
# Disconnect from a LaminDB instance
lamin_disconnect()
# ->
lc$disconnect()
## End(Not run)
## Not run:
# Log in as a LaminDB user
lamin_login(...)
# ->
lc$login(...)
## End(Not run)
## Not run:
# Log out of LaminDB
lamin_logout()
# ->
lc$logout()
## End(Not run)
## Not run:
# Create a new LaminDB instance
lamin_init(...)
# ->
lc$init(...)
## End(Not run)
## Not run:
# Create a temporary LaminDB instance
lamin_init_temp(...)
# ->
create_temporary_instance()
## End(Not run)
## Not run:
# Delete a LaminDB entity
lamin_delete(...)
# ->
lc$delete(...)
## End(Not run)
## Not run:
# Save to a LaminDB instance
lamin_save(...)
# ->
lc$save(...)
## End(Not run)
## Not run:
# Access Lamin settings
lamin_settings()
# ->
ln$setup$settings
# OR
ln$settings
# Alternatively
get_current_lamin_settings()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.