hopsworks #
[source] 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 Serverless Hopsworks by calling the hopsworks.login() function with no arguments.
Connect to Serverless
import hopsworks
project = hopsworks.login()
Alternatively, connect to your own Hopsworks installation by specifying the host, port and API key.
Connect to your Hopsworks cluster
import hopsworks
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, 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. |
[source] 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: |
description | Description of the project. TYPE: |
feature_store_topic | Feature store topic name. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
project.Project | None | The Project object to perform operations on. |
[source] get_secrets_api #
get_secrets_api() -> secret_api.SecretsApi
Get the secrets api.
| RETURNS | DESCRIPTION |
|---|---|
secret_api.SecretsApi | The Secrets API handle. |