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.
Returned by
role property #
role: str | None
Project role of the member, for example "Data owner" or "Data scientist".
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: |
| 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 TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
ProjectMember | This |
| RAISES | DESCRIPTION |
|---|---|
ValueError | If |
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request, for example if the caller is not a project owner. |