Init a local instance¶
!lamin login testuser1
import lamindb_setup as ln_setup
ln_setup.init(storage="./mydata")
Show code cell content
from pathlib import Path
assert ln_setup.settings.instance.storage.type_is_cloud == False
assert ln_setup.settings.instance.owner == ln_setup.settings.user.handle
assert ln_setup.settings.instance.name == "mydata"
assert ln_setup.settings.storage.root.as_posix() == Path("mydata").resolve().as_posix()
storage_root = ln_setup.settings.storage.root
assert storage_root.exists()
assert ln_setup.settings.storage.id is not None
assert (
ln_setup.settings.instance.db
== f"sqlite:///{Path('./mydata').resolve().as_posix()}/{ln_setup.settings.instance._id.hex}.lndb"
)
ln_setup.delete("mydata", force=True)
from lamindb_setup.core._settings_store import instance_settings_file
settings_file = instance_settings_file("mydata", "testuser1")
assert not storage_root.exists()
assert settings_file.exists() == False