Skip to content

hopsworks.core.app_api #

AppApi #

get_apps #

get_apps() -> list[app.App]

Get all apps in the project.

RETURNS DESCRIPTION
list[app.App]

List of App objects.

get_app #

get_app(name: str) -> app.App

Get an app by name.

PARAMETER DESCRIPTION
name

Name of the app.

TYPE: str

RETURNS DESCRIPTION
app.App

App object.

RAISES DESCRIPTION
hopsworks.client.exceptions.RestAPIError

If the app does not exist or the backend encounters an error.

create_app #

create_app(
    name: str,
    app_path: str,
    environment: str = "python-app-pipeline",
    memory: int = 2048,
    cores: float = 1.0,
) -> app.App

Create a new Streamlit app.

Example
import hopsworks

project = hopsworks.login()
apps = project.get_app_api()

app = apps.create_app(
    "my_dashboard",
    app_path="Resources/app.py",
)

app.run()
print(app.app_url)
PARAMETER DESCRIPTION
name

Name of the app.

TYPE: str

app_path

Path to the Streamlit .py file in HopsFS.

TYPE: str

environment

Python environment name (default: "python-app-pipeline").

TYPE: str DEFAULT: 'python-app-pipeline'

memory

Memory in MB (default: 2048).

TYPE: int DEFAULT: 2048

cores

CPU cores (default: 1.0).

TYPE: float DEFAULT: 1.0

RETURNS DESCRIPTION
app.App

The created App object.