Open Zethson opened 1 year ago
Could be done with rich like this:
from rich.console import Console
console = Console()
user_info = {
"Handle": "zethson",
"Email": "lukas.heumos@posteo.net",
"ID": "I5DPZdiE"
}
instance_info = {
"Owner": "zethson",
"Name": "lukas-bionty-test",
"Storage Root": "s3://lukas-bionty-test/",
"Storage Region": "eu-central-1",
"Database": "sqlite:////home/zeth/.cache/lamindb/lukas-bionty-test/lukas-bionty-test.lndb",
"Schema": "{'bionty'}"
}
console.rule("User Information", style="blue")
for key, value in user_info.items():
console.print(f"- [cyan]{key}[/cyan]: {value}")
console.rule("Current Instance", style="blue")
for key, value in instance_info.items():
console.print(f"- [cyan]{key}[/cyan]: {value}")
The function
from ._settings import settings
def info():
"""Log information about current instance & user."""
# Accessing cached settings is faster than accessing the hub
print(settings.user)
if settings._instance_exists:
print(settings.instance)
else:
print("No instance loaded: lamin load <instance>")
already returns the "current user" bla so it's annoying to format it
lamin info
gives
without any colors. Think we can do better.
isn't really pretty. We could prettify this with a Rich table