hopsworks.project #
Project #
Class representing a Hopsworks project.
Use hopsworks.login to get the current project after logging in.
Use hopsworks.create_project to create a new project and get the project object.
created property #
Timestamp when the project was created.
department property #
department: str | None
Name of the department the project belongs to.
Administrators group projects into departments; a project created without one is in the default department. None from a Hopsworks version that predates departments.
description property #
Description of the project.
home_path property #
home_path: str
Path to the current user's home directory within this project.
The home directory is located at /Projects/<project_name>/Users/<username> and is created automatically when a user joins a project.
id property #
Id of the project.
name property #
Name of the project.
owner property #
Owner of the project.
project_namespace property #
Kubernetes namespace used by project.
add_member #
add_member(
email: str, role: str
) -> project_member.ProjectMember
Add a user to the project.
Example
| PARAMETER | DESCRIPTION |
|---|---|
email | Email address of the user to add. TYPE: |
role | The project role to grant, one of TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
project_member.ProjectMember | The newly added |
| RAISES | DESCRIPTION |
|---|---|
ValueError | If |
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request, for example if the caller is not a project owner or may not give the role. |
create_featurestore_alert #
create_featurestore_alert(
receiver: str,
status: Literal[
"feature_validation_success",
"feature_validation_warning",
"feature_validation_failure",
"monitoring_shift_undetected",
"monitoring_shift_detected",
"monitoring_empty_detection_window",
"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
| PARAMETER | DESCRIPTION |
|---|---|
receiver | The receiver of the alert. TYPE: |
status | The status of the alert. The names feature_monitor_shift_undetected and feature_monitor_shift_detected are deprecated since ~=3.8.1 and will be removed in a future release. TYPE: |
severity | The severity of the alert. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
alert.ProjectAlert | The created |
| RAISES | DESCRIPTION |
|---|---|
ValueError | If |
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
| PARAMETER | DESCRIPTION |
|---|---|
receiver | The receiver of the alert. TYPE: |
status | The status of the alert. TYPE: |
severity | The severity of the alert. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
alert.ProjectAlert | The created |
| RAISES | DESCRIPTION |
|---|---|
ValueError | If |
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |
get_agent_serving #
Connect to the project's Agent Serving API.
The agents deployed in the project: send them messages, read their traces and feedback, run evaluation suites against them, and review what the failure analysis found.
Example for getting the Agent Serving API of a project
| RETURNS | DESCRIPTION |
|---|---|
AgentServing | The Agent Serving API. |
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: |
| 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 |
| 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_app_api #
get_app_api() -> app_api.AppApi
Get the app API for the project.
Use this to manage Streamlit apps.
| RETURNS | DESCRIPTION |
|---|---|
app_api.AppApi | The App 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) -> FeatureStore
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
| PARAMETER | DESCRIPTION |
|---|---|
name | Project name of the feature store. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
FeatureStore | The Feature Store API. |
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |
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_gpu_availability #
get_gpu_availability() -> gpu_availability.GpuAvailability
Get the GPUs this project can use.
When NVIDIA Run:ai manages the cluster's GPUs, this reports the project's and its department's Run:ai quota and allocation, and how many GPUs are available within quota and over quota. Otherwise it reports the cluster's GPU inventory. The call has no side effects: a project not bound to a Run:ai project yet, or a Run:ai control plane that cannot be reached, is reported in warnings (RUN_AI_PROJECT_NOT_BOUND, RUN_AI_UNREACHABLE) with no numbers rather than raised.
Example
| RETURNS | DESCRIPTION |
|---|---|
gpu_availability.GpuAvailability | The project's GPU availability. |
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |
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_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_members #
get_members() -> list[project_member.ProjectMember]
Get all members of the project.
Example
| RETURNS | DESCRIPTION |
|---|---|
list[project_member.ProjectMember] | List of |
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |
get_members_api #
get_members_api() -> project_members_api.ProjectMembersApi
Get the project members API for the project.
Use this to manage who has access to the project and at which role.
| RETURNS | DESCRIPTION |
|---|---|
project_members_api.ProjectMembersApi | The Project Members Api handle. |
get_model_registry #
get_model_registry() -> ModelRegistry
Connect to Project's Model Registry API.
Example for getting the Model Registry API of a project
| RETURNS | DESCRIPTION |
|---|---|
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() -> ModelServing
Connect to Project's Model Serving API.
Example for getting the Model Serving API of a project
| RETURNS | DESCRIPTION |
|---|---|
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_semantic_layer_api #
get_semantic_layer_api() -> (
semantic_layer_api.SemanticLayerApi
)
Get the Semantic Layer API for the project, to register semantic projects and query their metrics.
It works from outside the cluster too, since the semantic gateway is reached through the Hopsworks host.
Example
| RETURNS | DESCRIPTION |
|---|---|
semantic_layer_api.SemanticLayerApi | The Semantic Layer API handle. |
get_superset_api #
get_superset_api() -> superset_api.SupersetApi
Get the Superset API for the project.
| RETURNS | DESCRIPTION |
|---|---|
superset_api.SupersetApi | The Superset API handle. |
get_trino_api #
get_trino_api() -> trino_api.TrinoApi
Get the Trino API for the project.
| RETURNS | DESCRIPTION |
|---|---|
trino_api.TrinoApi | The Trino API handle. |
get_trino_catalog_api #
get_trino_catalog_api() -> (
trino_catalog_api.TrinoCatalogApi
)
Get the Trino catalog API for the project.
Distinct from get_trino_api, which connects to the query engine and runs queries. This one manages which sources the engine can query, and the restart that applies a change.
Example
| RETURNS | DESCRIPTION |
|---|---|
trino_catalog_api.TrinoCatalogApi | The Trino catalog API handle. |
remove_member #
remove_member(
email: str,
delete_home_dir: bool = False,
new_file_owner: str | None = None,
) -> None
Remove a user from the project.
Deletes the member's project files when delete_home_dir=True
All files under this member's home directory in the project are permanently deleted and cannot be recovered.
| PARAMETER | DESCRIPTION |
|---|---|
email | Email address of the member to remove. TYPE: |
delete_home_dir | Whether to also delete the member's home directory in the project. TYPE: |
new_file_owner | Email address of the data owner that takes over the removed member's home directory. Defaults to the data owner who has been in the project longest. The semantic projects the member owns go to this data owner too, or to the caller when none is given or this one may not run their exports. TYPE: |
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request, for example if a data scientist tries to remove someone other than themselves. The removal is also refused when the member owns semantic projects that neither |
transfer_ownership #
transfer_ownership(email: str) -> None
Hand the project over to another data owner of the project.
Only the current owner can do this. The previous owner stays a data owner, so they can afterwards be removed with remove_member. This also works in projects whose members are managed by group mapping, since no membership changes.
Example
| PARAMETER | DESCRIPTION |
|---|---|
email | Email address of the data owner who becomes the project owner. TYPE: |
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request, for example if the caller does not own the project or the new owner is not a data owner of it. With error code 150127 the owner has already changed and only a follow-up step failed; the project then names the new owner, and the new owner can finish the transfer by handing the project to themselves. |