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 a project.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
new name of the project |
None
|
Returns:
| Type | Description |
|---|---|
Self
|
updated project object |
retrieve_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
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 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 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 |
set_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:
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
Retrieves the default project from the API.
Returns:
| Type | Description |
|---|---|
Project
|
project object representing the default project |
Raises:
| Type | Description |
|---|---|
HTTPStatusError
|
API request fails |