Skip to main content
Version: Next

Projects

In H2O MLOps, a project is the main entity that contains artifacts, experiments, models, and deployments. Projects are designed to be collaborative, and can be shared between multiple individuals. Additionally, project owners can specify role-based access control for each individual that is invited to collaborate on a project. Projects can be used to group all work items for a specific team or use case.

This guide explains how to create, view, update, share, transfer ownership, and delete projects in H2O MLOps using the Python client.

To get started, connect to H2O MLOps as described in Connect to H2O MLOps.

Create a project

This section describes how to create a new project in H2O MLOps using the Python client.

Create a new project using the projects.create() method.

Input:

project = mlops.projects.create(name="your-project-name", description="your-project-description")

Parameters:

  • name: The name of the project.
  • description: A short description of the project.

View projects

This section describes how to view existing projects in H2O MLOps using the Python client.

List all projects

List all existing projects using the projects.list() method.

Input:

mlops.projects.list()

This returns a list of all available projects.

Output:

  | name   | uid
--+--------+--------------------------------------
0 | test1 | 00765889-f506-432a-a0a4-46b57f714731
1 | test2 | 0169ce1c-8acb-4a64-b576-40156e10237d
2 | test3 | 04c16b72-170e-4f9f-a96b-c5465528090b

Filter projects

Use the projects.list() method with key-value arguments to filter the projects.

Input:

mlops.projects.list(name="test2")

This returns a list of matching projects as a table.

Output:

  | name   | uid
--+--------+--------------------------------------
0 | test2 | 0169ce1c-8acb-4a64-b576-40156e10237d

Retrieve a project

To retrieve a specific project, use the projects.get() method with the project UID.

Input:

project = mlops.projects.get(uid="00765889-f506-432a-a0a4-46b57f714731")
project
note

You can also retrieve a project from the list of projects.
For example, project = mlops.projects.list(key=value)[index]. The key and value arguments are optional.

Output:

<class 'h2o_mlops._projects.MLOpsProject(
uid='00765889-f506-432a-a0a4-46b57f714731',
name='test1',
description='test project',
owner_username='example.user@example.com',
created_time=datetime.datetime(2025, 4, 29, 5, 41, 11, 41735, tzinfo=tzutc()),
last_modified_time=datetime.datetime(2025, 4, 29, 5, 41, 11, 41735, tzinfo=tzutc())
)'>

A project has the following main properties:

  • uid: The unique identifier of the project.
  • name: The name of the project.
  • description: A description of the project.
  • owner: The project owner.
  • created_time: The timestamp when the project was created.
  • last_modified_time: The timestamp of the last modification.

Update a project

You can update only the name and description fields of a project.

Make sure to retrieve the project instance as described in Retrieve a project before proceeding.

Input:

project.update(name="new-test1")
project

Output:

<class 'h2o_mlops._projects.MLOpsProject(
uid='00765889-f506-432a-a0a4-46b57f714731',
name='new-test1',
description='test project',
owner_username='example.user@example.com',
created_time=datetime.datetime(2025, 4, 29, 5, 41, 11, 41735, tzinfo=tzutc()),
last_modified_time=datetime.datetime(2025, 4, 29, 5, 41, 11, 41735, tzinfo=tzutc())
)'>

Share a project

This section demonstrates how to share a project with another user using the MLOps Python client.

  1. Fetch the user.

    Input:

    user = mlops.users.list(username="user2@gmail.com")[0]
    user
    note

    Usernames are not unique. Use the user ID as the unique identifier.
    For example: user = mlops.users.get(uid="725b266e-0442-4bc6-a38b-ea4ce9270f50")

    Output:

    <class 'h2o_mlops._users.MLOpsUser(
    uid='725b266e-0442-4bc6-a38b-ea4ce9270f50',
    username='user2@gmail.com',
    email='',
    created_time=datetime.datetime(2024, 10, 8, 11, 8, 58, 562604, tzinfo=tzutc()),
    )'>
  2. Share the project with the user.

    Note

    Two basic roles are available for default installations of MLOps:

    • Default - Read/Write access
    • Reader - only Read access

    Input:

    project.share(user=user, sharing_role="Default")
  3. List sharing details.

    Input:

    project.sharings()

    Output:

        | username         | sharing_role   | sharing_type   | shared_time
    ----+------------------+----------------+----------------+------------------------
    0 | user2@gmail.com | Default | USER_CREATED | 2025-04-29 05:50:19 AM
    1 | user1@gmail.com | | OWNER | 2025-04-29 05:41:11 AM
  4. Unshare the project.

    Input:

    project.unshare(user=user)

    Verify by listing sharing details again:

    Input:

    project.sharings()

    Output:

        | username          | sharing_role   | sharing_type   | shared_time
    ----+-------------------+----------------+----------------+------------------------
    0 | user1@gmail.com | | OWNER | 2025-04-29 05:41:11 AM

Transfer ownership

This section describes how to transfer ownership of a project to another user.

  1. Fetch the new owner.

    Input:

    user = mlops.users.list(username="user2@gmail.com")[0]
    note

    Usernames are not unique. Use the user ID as the unique identifier.
    For example: user = mlops.users.get(uid="725b266e-0442-4bc6-a38b-ea4ce9270f50")

  2. Transfer project ownership.

    Input:

    project.transfer_ownership(new_owner=user)
    project

    Output:

    <class 'h2o_mlops._projects.MLOpsProject(
    uid='00765889-f506-432a-a0a4-46b57f714731',
    name='new-test1',
    description='test project',
    owner_username='user2@gmail.com',
    created_time=datetime.datetime(2025, 4, 29, 5, 41, 11, 41735, tzinfo=tzutc()),
    last_modified_time=datetime.datetime(2025, 4, 29, 5, 42, 22, 308077, tzinfo=tzutc())
    )'>

Delete projects

This section describes how to delete the projects.

Delete using a project instance

If you already have a reference to the project object, use the delete() method:

Input:

project.delete()

Delete using project UIDs

You can also delete multiple projects at once by specifying their UIDs:

Input:

mlops.projects.delete(
uids=[
"0169ce1c-8acb-4a64-b576-40156e10237d",
"04c16b72-170e-4f9f-a96b-c5465528090b",
],
)

Output:

    | project_uid                          | is_deleted   | message
----+--------------------------------------+--------------+-----------
0 | 0169ce1c-8acb-4a64-b576-40156e10237d | True |
1 | 04c16b72-170e-4f9f-a96b-c5465528090b | True |

Feedback