Skip to content

hopsworks.project_member #

ProjectMember #

Represents a user's membership and role in a Hopsworks project.

Use Project.get_members to list the members of a project, or ProjectMembersApi for the full set of member-management operations.

email property #

email: str | None

Email address of the project member.

first_name property #

first_name: str | None

First name of the project member.

last_name property #

last_name: str | None

Last name of the project member.

project_id property #

project_id: int | None

Id of the project this membership belongs to.

role property #

role: str | None

Project role of the member, for example "Data owner" or "Data scientist".

user property #

user: user_mod.User | None

The User backing this membership.

username property #

username: str | None

Hopsworks username of the project member.

remove #

remove(delete_home_dir: bool = False) -> None

Remove this member 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.

Example
import hopsworks

project = hopsworks.login()

member = next(m for m in project.get_members() if m.email == "alice@example.com")
member.remove()
PARAMETER DESCRIPTION
delete_home_dir

Whether to also delete the member's home directory in the project.

TYPE: bool DEFAULT: False

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.

update_role #

update_role(role: str) -> ProjectMember

Change this member's role in the project.

Example
import hopsworks

project = hopsworks.login()

member = next(m for m in project.get_members() if m.email == "alice@example.com")
member.update_role("Observer")
PARAMETER DESCRIPTION
role

The new project role, one of Data owner, Data scientist, Observer, Feature store restricted.

TYPE: str

RETURNS DESCRIPTION
ProjectMember

This ProjectMember, updated with the new role.

RAISES DESCRIPTION
ValueError

If role is not a settable project role.

hopsworks.client.exceptions.RestAPIError

If the backend encounters an error when handling the request, for example if the caller is not a project owner.