Skip to content

Connection API#

Creation#

[source]

connection#

Connection.connection(
    host=None,
    port=443,
    project=None,
    hostname_verification=True,
    trust_store_path=None,
    cert_folder="/tmp",
    api_key_file=None,
    api_key_value=None,
)

Connection factory method, accessible through hopsworks.connection().


Properties#

[source]

api_key_file#


[source]

api_key_value#


[source]

cert_folder#


[source]

host#


[source]

hostname_verification#


[source]

port#


[source]

project#


[source]

trust_store_path#


Methods#

[source]

close#

Connection.close()

Close a connection gracefully.

This will clean up any materialized certificates on the local file system of external environments such as AWS SageMaker.

Usage is optional.


[source]

connect#

Connection.connect()

Instantiate the connection.

Creating a Connection object implicitly calls this method for you to instantiate the connection. However, it is possible to close the connection gracefully with the close() method, in order to clean up materialized certificates. This might be desired when working on external environments such as AWS SageMaker. Subsequently you can call connect() again to reopen the connection.

Example

import hopsworks
conn = hopsworks.connection()
conn.close()
conn.connect()

[source]

connection#

Connection.connection(
    host=None,
    port=443,
    project=None,
    hostname_verification=True,
    trust_store_path=None,
    cert_folder="/tmp",
    api_key_file=None,
    api_key_value=None,
)

Connection factory method, accessible through hopsworks.connection().


[source]

create_project#

Connection.create_project(name, description=None, feature_store_topic=None)

Create a new project.

Example for creating a new project

import hopsworks

connection = hopsworks.connection()

connection.create_project("my_hopsworks_project", description="An example Hopsworks project")
Arguments

  • name str: The name of the project.
  • description str: optional description of the project
  • feature_store_topic str: optional feature store topic name

Returns

Project. A project handle object to perform operations on.


[source]

get_project#

Connection.get_project(name=None)

Get an existing project.

Arguments

  • name str: The name of the project.

Returns

Project. A project handle object to perform operations on.


[source]

get_projects#

Connection.get_projects()

Get all projects.

Returns

List[Project]: List of Project objects


[source]

get_secrets_api#

Connection.get_secrets_api()

Get the secrets api.

Returns

SecretsApi: The Secrets Api handle


[source]

project_exists#

Connection.project_exists(name)

Check if a project exists.

Arguments

  • name str: The name of the project.

Returns

bool. True if project exists, otherwise False