Skip to content

Login API#

[source]

login#

hopsworks.login(host=None, port=443, project=None, api_key_value=None, api_key_file=None)

Connect to Serverless Hopsworks by calling the hopsworks.login() function with no arguments.

project = hopsworks.login()

Alternatively, connect to your own Hopsworks installation by specifying the host, port and api key.

project = hopsworks.login(host="my.hopsworks.server",
                          port=8181,
                          api_key_value="DKN8DndwaAjdf98FFNSxwdVKx")

In addition to setting function arguments directly, hopsworks.login() also reads the environment variables: HOPSWORKS_HOST, HOPSWORKS_PORT, HOPSWORKS_PROJECT and HOPSWORKS_API_KEY.

The function arguments do however take precedence over the environment variables in case both are set.

Arguments

  • host Optional[str]: The hostname of the Hopsworks instance, defaults to None.
  • port int: The port on which the Hopsworks instance can be reached, defaults to 443.
  • project Optional[str]: Name of the project to access. If used inside a Hopsworks environment it always gets the current project. If not provided you will be prompted to enter it.
  • api_key_value Optional[str]: Value of the Api Key
  • api_key_file Optional[str]: Path to file wih Api Key

Returns

Project: The Project object

Raises

  • RestAPIError: If unable to connect to Hopsworks

Feature Store API#

[source]

get_feature_store#

Project.get_feature_store()

Connect to Project's Feature Store API.

Returns

hsfs.feature_store.FeatureStore: The Feature Store API

Raises

  • RestAPIError: If unable to connect

Model Registry API#

[source]

get_model_registry#

Project.get_model_registry()

Connect to Project's Model Registry API. Returns

hsml.model_registry.ModelRegistry: The Model Registry API

Raises

  • RestAPIError: If unable to connect

Model Serving API#

[source]

get_model_serving#

Project.get_model_serving()

Connect to Project's Model Serving API.

Returns

hsml.model_serving.ModelServing: The Model Serving API

Raises

  • RestAPIError: If unable to connect