Connect to local instance

!lamin disconnect
!lamin delete --force mydata
!lamin init --storage mydata
!lamin disconnect
import lamindb_setup as ln_setup

Load your own instance by name

If the user is the instance owner, load the instance by name:

ln_setup.connect("mydata")
Hide code cell content
from pathlib import Path

assert ln_setup.settings.instance.storage.type_is_cloud == False
assert ln_setup.settings.instance.name == "mydata"

root_path = Path("./mydata").resolve()
assert ln_setup.settings.instance.storage.root == root_path
assert (
    ln_setup.settings.instance.db
    == f"sqlite:///{root_path.as_posix()}/{ln_setup.settings.instance._id.hex}.lndb"
)

Delete:

assert ln_setup.settings._instance_settings_path.exists()
ln_setup.delete("mydata", force=True)
assert not ln_setup.settings._instance_settings_path.exists()