Skip to content

Projects#

hopsworks.create_project #

create_project(
    name: str,
    description: str | None = None,
    feature_store_topic: str | None = None,
) -> project.Project | None

Create a new project.

Not supported

The function does not work if you are connected to Serverless Hopsworks.

Example for creating a new project
import hopsworks

hopsworks.login(...)

hopsworks.create_project("my_project", description="An example Hopsworks project")
PARAMETER DESCRIPTION
name

The name of the project.

TYPE: str

description

Description of the project.

TYPE: str | None DEFAULT: None

feature_store_topic

Feature store topic name.

TYPE: str | None DEFAULT: None

RETURNS DESCRIPTION
project.Project | None

The Project object to perform operations on.

hopsworks.project.Project #

created property #

created

Timestamp when the project was created.

description property #

description

Description of the project.

id property #

id

Id of the project.

name property #

name

Name of the project.

owner property #

owner

Owner of the project.

project_namespace property #

project_namespace

Kubernetes namespace used by project.

create_featurestore_alert #

create_featurestore_alert(
    receiver: str,
    status: Literal[
        "feature_validation_success",
        "feature_validation_warning",
        "feature_validation_failure",
        "feature_monitor_shift_undetected",
        "feature_monitor_shift_detected",
    ],
    severity: Literal["critical", "warning", "info"],
) -> alert.ProjectAlert

Create an alert for feature validation and monitoring in this project.

Example for creating a featurestore alert
import hopsworks
project = hopsworks.login()
project.create_featurestore_alert("my_receiver", "feature_validation_success", "info")
PARAMETER DESCRIPTION
receiver

The receiver of the alert.

TYPE: str

status

The status of the alert.

TYPE: Literal['feature_validation_success', 'feature_validation_warning', 'feature_validation_failure', 'feature_monitor_shift_undetected', 'feature_monitor_shift_detected']

severity

The severity of the alert.

TYPE: Literal['critical', 'warning', 'info']

RETURNS DESCRIPTION
alert.ProjectAlert

The created ProjectAlert object.

RAISES DESCRIPTION
ValueError

If status or severity is invalid, also if receiver is None.

hopsworks.client.exceptions.RestAPIError

If the backend encounters an error when handling the request.

create_job_alert #

create_job_alert(
    receiver: str,
    status: Literal[
        "job_finished",
        "job_failed",
        "job_killed",
        "job_long_running",
    ],
    severity: Literal["critical", "warning", "info"],
) -> alert.ProjectAlert

Create an alert for jobs in this project.

Example for creating a job alert
import hopsworks
project = hopsworks.login()
project.create_job_alert("my_receiver", "long_running", "info")
PARAMETER DESCRIPTION
receiver

The receiver of the alert.

TYPE: str

status

The status of the alert.

TYPE: Literal['job_finished', 'job_failed', 'job_killed', 'job_long_running']

severity

The severity of the alert.

TYPE: Literal['critical', 'warning', 'info']

RETURNS DESCRIPTION
alert.ProjectAlert

The created ProjectAlert object.

RAISES DESCRIPTION
ValueError

If status or severity is invalid, also if receiver is None.

hopsworks.client.exceptions.RestAPIError

If the backend encounters an error when handling the request.

get_alert #

get_alert(alert_id: int) -> alert.ProjectAlert | None

Get an alert for the project by ID.

PARAMETER DESCRIPTION
alert_id

The ID of the alert.

TYPE: int

RETURNS DESCRIPTION
alert.ProjectAlert | None

The ProjectAlert object.

get_alerts #

get_alerts() -> list[alert.ProjectAlert]

Get all alerts for the project.

RETURNS DESCRIPTION
list[alert.ProjectAlert]

List of ProjectAlert objects.

RAISES DESCRIPTION
hopsworks.client.exceptions.RestAPIError

If the backend encounters an error when handling the request.

get_alerts_api #

get_alerts_api() -> alerts_api.AlertsApi

Get the alerts api for the project.

RETURNS DESCRIPTION
alerts_api.AlertsApi

The Alerts Api handle.

get_dataset_api #

get_dataset_api() -> dataset_api.DatasetApi

Get the dataset api for the project.

RETURNS DESCRIPTION
dataset_api.DatasetApi

The Datasets Api handle.

get_environment_api #

get_environment_api() -> environment_api.EnvironmentApi

Get the Python environment API for the project.

RETURNS DESCRIPTION
environment_api.EnvironmentApi

The Python Environment Api handle.

get_feature_store #

get_feature_store(name: str | None = None)

Connect to Project's Feature Store.

Defaulting to the project name of default feature store. To get a shared feature store, the project name of the feature store is required.

Example for getting the Feature Store API of a project
import hopsworks

project = hopsworks.login()

fs = project.get_feature_store()
PARAMETER DESCRIPTION
name

Project name of the feature store.

TYPE: str | None DEFAULT: None

RETURNS DESCRIPTION

hsfs.feature_store.FeatureStore: The Feature Store API.

RAISES DESCRIPTION
hopsworks.client.exceptions.RestAPIError

If the backend encounters an error when handling the request.

get_flink_cluster_api() -> (
    flink_cluster_api.FlinkClusterApi
)

Get the flink cluster API for the project.

RETURNS DESCRIPTION
flink_cluster_api.FlinkClusterApi

The Flink Cluster Api handle.

get_git_api #

get_git_api() -> git_api.GitApi

Get the git repository api for the project.

RETURNS DESCRIPTION
git_api.GitApi

The Git Api handle.

get_job_api #

get_job_api() -> job_api.JobApi

Get the job API for the project.

RETURNS DESCRIPTION
job_api.JobApi

The Job Api handle.

get_jobs_api #

get_jobs_api()

Deprecated, use get_job_api instead. Excluded from docs to prevent API breakage.

get_kafka_api #

get_kafka_api() -> kafka_api.KafkaApi

Get the kafka api for the project.

RETURNS DESCRIPTION
kafka_api.KafkaApi

The Kafka Api handle.

get_model_registry #

get_model_registry()

Connect to Project's Model Registry API.

Example for getting the Model Registry API of a project
import hopsworks

project = hopsworks.login()

mr = project.get_model_registry()
RETURNS DESCRIPTION

hsml.model_registry.ModelRegistry: The Model Registry API.

RAISES DESCRIPTION
hopsworks.client.exceptions.RestAPIError

If the backend encounters an error when handling the request.

get_model_serving #

get_model_serving()

Connect to Project's Model Serving API.

Example for getting the Model Serving API of a project
import hopsworks

project = hopsworks.login()

ms = project.get_model_serving()
RETURNS DESCRIPTION

hsml.model_serving.ModelServing: The Model Serving API.

RAISES DESCRIPTION
hopsworks.client.exceptions.RestAPIError

If the backend encounters an error when handling the request.

get_opensearch_api #

get_opensearch_api() -> opensearch_api.OpenSearchApi

Get the opensearch api for the project.

RETURNS DESCRIPTION
opensearch_api.OpenSearchApi

The OpenSearch Api handle.

get_search_api #

get_search_api() -> search_api.SearchApi

Get the search api for the project.

RETURNS DESCRIPTION
search_api.SearchApi

The Search Api handle.

get_url #

get_url()

Get url to the project in Hopsworks.