Skip to content

Project

Project pydantic-model

Bases: BaseModel

A class representing a project in the Rowan API.

Attributes:

Name Type Description
uuid str

UUID of the project

name str | None

name of the project

created_at datetime | None

date and time the project was created

Show JSON schema:
{
  "description": "A class representing a project in the Rowan API.\n\nAttributes:\n    uuid: UUID of the project\n    name: name of the project\n    created_at: date and time the project was created",
  "properties": {
    "uuid": {
      "title": "Uuid",
      "type": "string"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Name"
    },
    "root_folder_uuid": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Root Folder Uuid"
    },
    "created_at": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Created At"
    }
  },
  "required": [
    "uuid"
  ],
  "title": "Project",
  "type": "object"
}

Fields:

  • uuid (str)
  • name (str | None)
  • root_folder_uuid (str | None)
  • created_at (datetime | None)

update

update(name: str | None = None) -> Self

Update a project.

Parameters:

Name Type Description Default
name str | None

new name of the project

None

Returns:

Type Description
Self

updated project object

delete

delete() -> None

Delete the project.

This is a destructive action, it will delete all the folders and workflows that are inside this project.

Raises:

Type Description
HTTPStatusError

request to the API fails

retrieve_project

retrieve_project(uuid: str) -> Project

Retrieves a project from the API by UUID. Project UUID can be found in the project's URL.

Parameters:

Name Type Description Default
uuid str

UUID of the project to retrieve

required

Returns:

Type Description
Project

project object representing the retrieved project

Raises:

Type Description
HTTPStatusError

API request fails

list_projects

list_projects(name_contains: str | None = None, page: int = 0, size: int = 10) -> list[Project]

Retrieve a list of projects based on the specified criteria.

Parameters:

Name Type Description Default
name_contains str | None

substring to search for in project names

None
page int

pagination parameter to specify the page number

0
size int

pagination parameter to specify the number of items per page

10

Returns:

Type Description
list[Project]

list of Folder objects that match the search criteria

Raises:

Type Description
HTTPStatusError

request to the API fails

create_project

create_project(name: str) -> Project

Create a new project.

Parameters:

Name Type Description Default
name str

name of the project

required

Returns:

Type Description
Project

newly created project

get_project

get_project(name: str, create: bool = False) -> Project

Get a project by exact name, optionally creating it if it does not exist.

The project analogue of get_folder. Unlike get_folder, create defaults to False: a project is a top-level container, so a typo should raise rather than silently spawn a new one. Does not change the active project - assign rowan.project_uuid or use set_project for that.

Parameters:

Name Type Description Default
name str

exact name of the project

required
create bool

create the project when no exact match exists

False

Returns:

Type Description
Project

matched (or newly created) project

Raises:

Type Description
ValueError

no match is found and create is False

set_project

set_project(name: str) -> Project

Set the active project by name for all subsequent API calls.

This is equivalent to setting rowan.project_uuid directly, but lets you use a human-readable name instead of a UUID.

Examples:

rowan.set_project("CDK2 campaign")
folder = rowan.get_folder("docking/batch_1")

Parameters:

Name Type Description Default
name str

exact name of the project to activate

required

Returns:

Type Description
Project

matched project

Raises:

Type Description
ValueError

no project with that name is found

default_project

default_project() -> Project

Retrieves the default project from the API.

Returns:

Type Description
Project

project object representing the default project

Raises:

Type Description
HTTPStatusError

API request fails

get_project_uuid

get_project_uuid() -> str | None

Get the active project UUID from the module-level attribute rowan.project_uuid.

Returns:

Type Description
str | None

project UUID string, or None if not set