Skip to main content

Project

A class representing a project in the Union API.

Attributes

AttributeTypeDescription
pb2project_service_pb2.ProjectThe underlying protobuf message object containing the raw project data and metadata.

Constructor

Signature

def Project(
pb2: project_service_pb2.Project
) - > null

Parameters

NameTypeDescription
pb2project_service_pb2.ProjectThe protocol buffer object containing project data.

Methods


get()

@classmethod
def get(
name: str
) - > [Project](project.md?sid=flyte_remote__project_project)

Get a project by name.

Parameters

NameTypeDescription
namestrThe unique name or identifier of the project to retrieve.

Returns

TypeDescription
[Project](project.md?sid=flyte_remote__project_project)The Project instance matching the provided name.

create()

@classmethod
def create(
id: str,
name: str,
description: str = "",
labels: Dict[str, str]| None = null
) - > [Project](project.md?sid=flyte_remote__project_project)

Create a new project.

Parameters

NameTypeDescription
idstrThe unique identifier for the project.
namestrThe display name for the project.
descriptionstr = ""A description for the project.
labels`Dict[str, str]None` = null

Returns

TypeDescription
[Project](project.md?sid=flyte_remote__project_project)The newly created Project instance.

update()

@classmethod
def update(
id: str,
name: str | None = null,
description: str | None = null,
labels: Dict[str, str]| None = null,
state: Literal["archived", "active"]| None = null
) - > [Project](project.md?sid=flyte_remote__project_project)

Update an existing project.

Parameters

NameTypeDescription
idstrThe id of the project to update.
name`strNone` = null
description`strNone` = null
labels`Dict[str, str]None` = null
state`Literal["archived", "active"]None` = null

Returns

TypeDescription
[Project](project.md?sid=flyte_remote__project_project)The updated Project instance reflecting the changes.

archive()

@classmethod
def archive() - > [Project](project.md?sid=flyte_remote__project_project)

Archive this project.

Returns

TypeDescription
[Project](project.md?sid=flyte_remote__project_project)The Project instance with its state updated to archived.

unarchive()

@classmethod
def unarchive() - > [Project](project.md?sid=flyte_remote__project_project)

Unarchive (activate) this project.

Returns

TypeDescription
[Project](project.md?sid=flyte_remote__project_project)The Project instance with its state updated to active.

listall()

@classmethod
def listall(
filters: str | None = null,
sort_by: Tuple[str, Literal["asc", "desc"]]| None = null,
archived: bool = false
) - > Union[AsyncIterator[[Project](project.md?sid=flyte_remote__project_project)], Iterator[[Project](project.md?sid=flyte_remote__project_project)]]

List all projects. By default, lists active (unarchived) projects. Set archived=True to list archived projects instead.

Parameters

NameTypeDescription
filters`strNone` = null
sort_by`Tuple[str, Literal["asc", "desc"]]None` = null
archivedbool = falseIf True, list archived projects. If False (default), list active projects.

Returns

TypeDescription
Union[AsyncIterator[[Project](project.md?sid=flyte_remote__project_project)], Iterator[[Project](project.md?sid=flyte_remote__project_project)]]An iterator of projects.