hopsworks #
login #
login(
host: str | None = None,
port: int = 443,
project: str | None = None,
api_key_value: str | None = None,
api_key_file: str | None = None,
hostname_verification: bool = False,
trust_store_path: str | None = None,
cert_folder: str | None = None,
engine: Literal[
"spark",
"python",
"training",
"spark-no-metastore",
"spark-delta",
]
| None = None,
) -> project.Project
Connect to Hopsworks SaaS by calling the hopsworks.login() function with no arguments.
Alternatively, connect to your own Hopsworks installation by specifying the host, port and API key.
Connect to your Hopsworks cluster
In addition to setting function arguments directly, hopsworks.login() also reads the environment variables: HOPSWORKS_HOST, HOPSWORKS_PORT, HOPSWORKS_PROJECT, HOPSWORKS_API_KEY, HOPSWORKS_HOSTNAME_VERIFICATION, HOPSWORKS_TRUST_STORE_PATH, HOPSWORKS_CERT_FOLDER and HOPSWORKS_ENGINE.
The function arguments do however take precedence over the environment variables in case both are set.
| PARAMETER | DESCRIPTION |
|---|---|
host | The hostname of the Hopsworks instance. TYPE: |
port | The port on which the Hopsworks instance can be reached. TYPE: |
project | 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. TYPE: |
api_key_value | Value of the API Key. TYPE: |
api_key_file | Path to file wih API Key. TYPE: |
hostname_verification | Whether to verify Hopsworks' certificate. TYPE: |
trust_store_path | Path on the file system containing the Hopsworks certificates. TYPE: |
cert_folder | The directory to store downloaded certificates. Defaults to the system temp directory. TYPE: |
engine | Specifies the engine to use. The default value is
TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
project.Project | The Project object to perform operations on. |
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |
hopsworks.client.exceptions.HopsworksSSLClientError | If SSLError is raised from underlying requests library. |
create_project #
create_project(
name: str,
description: str | None = None,
feature_store_topic: str | None = None,
namespace: str | None = None,
) -> project.Project | None
Create a new project.
Example for creating a new project
| PARAMETER | DESCRIPTION |
|---|---|
name | The name of the project. TYPE: |
description | Description of the project. TYPE: |
feature_store_topic | Feature store topic name. TYPE: |
namespace | Kubernetes namespace to use for the project. If TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
project.Project | None | The Project object to perform operations on. |
disable_usage_logging #
Disable anonymous usage logging for this SDK session.
Usage logging is already disabled by default; call this to be explicit or after it has been enabled elsewhere.
get_current_project #
get_env_vars_api #
get_env_vars_api() -> env_var_api.EnvVarsApi
Get the environment variables api.
| RETURNS | DESCRIPTION |
|---|---|
env_var_api.EnvVarsApi | The environment variables API handle. |
get_sdk_info #
get_sdk_info() -> str
Return the environment information the SDK reports for usage logging.
| RETURNS | DESCRIPTION |
|---|---|
str | A JSON string describing the SDK and runtime environment. |
get_secrets_api #
get_secrets_api() -> secret_api.SecretsApi
Get the secrets api.
| RETURNS | DESCRIPTION |
|---|---|
secret_api.SecretsApi | The Secrets API handle. |