> ## Documentation Index
> Fetch the complete documentation index at: https://docs.galileo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# projects

## Project

Represents a project in the Galileo platform.

Projects are containers for logs, traces, and other data in Galileo. All logs are stored
within a project, and users can create and manage projects to organize their LLM usage data.

**Arguments**

* `created_at` (`datetime.datetime`): The timestamp when the project was created.

* `created_by` (`str`): The identifier of the user who created the project.

* `id` (`str`): The unique identifier of the project.

* `updated_at` (`datetime.datetime`): The timestamp when the project was last updated.

* `bookmark` (`Union[Unset, bool]`): Whether the project is bookmarked. Defaults to False.

* `name` (`Union[None, Unset, str]`): The name of the project.

* `permissions` (`Union[Unset, list["Permission"]])`): The permissions associated with the project.

* `type` (`Union[None, ProjectType, Unset]`): The type of the project, typically GEN\_AI.

**Examples**

```python theme={null}
from galileo.projects import get_project, create_project, list_projects, delete_project

# Create a new project
project = create_project(name="My AI Project")

# Get a project by name
project = get_project(name="My AI Project")

# Get a project by ID
project = get_project(id="project-id-123")

# List all projects
projects = list_projects()
for project in projects:
    print(f"Project: {project.name} (ID: {project.id})")

# Delete a project by name
delete_project(name="My AI Project")

# Delete a project by ID
delete_project(id="project-id-123")
```

## Projects

### create

```python theme={null}
def create(self, name: str) -> Project
```

Creates a new project.

**Arguments**

* `name` (`str`): The name of the project.

**Raises**

* `errors.UnexpectedStatus`: If the server returns an undocumented status code and Client.raise\_on\_unexpected\_status is True.
* `httpx.TimeoutException`: If the request takes longer than Client.timeout.

**Returns**

* `Project`: The created project.

### delete\_project

```python theme={null}
def delete_project(self, id: Optional[str]=None, name: Optional[str]=None) -> bool
```

Internal method to handle project deletion logic.

### get

```python theme={null}
def get(self,
        *,
        id: Optional[str]=None,
        name: Optional[str]=None) -> Optional[Project]
```

Retrieves a project by id or name (exactly one of `id` or `name` must be provided).

**Arguments**

* `id` (`str`): The id of the project.
* `name` (`str`): The name of the project.

**Raises**

* `ValueError`: If neither or both `id` and `name` are provided.
* `errors.UnexpectedStatus`: If the server returns an undocumented status code and Client.raise\_on\_unexpected\_status is True.
* `httpx.TimeoutException`: If the request takes longer than Client.timeout.

**Returns**

* `Project`: The project.

### get\_with\_env\_fallbacks

```python theme={null}
def get_with_env_fallbacks(self,
                           *,
                           id: Optional[str]=None,
                           name: Optional[str]=None) -> Optional[Project]
```

Retrieves a project by id or name.

At least one of `id` or `name` must be provided (directly or via environment).
If both are provided, `id` takes precedence and `name` is ignored. If neither is
provided, the method will attempt to read from `GALILEO_PROJECT_ID` and
`GALILEO_PROJECT`; if both environment variables are set, `GALILEO_PROJECT_ID`
takes precedence.

**Arguments**

* `id` (`str`): The id of the project.
* `name` (`str`): The name of the project.

**Raises**

* `ValueError`: If neither `id` nor `name` is available (including after env fallbacks).
* `errors.UnexpectedStatus`: If the server returns an undocumented status code and Client.raise\_on\_unexpected\_status is True.
* `httpx.TimeoutException`: If the request takes longer than Client.timeout.

**Returns**

* `Project`: The project.

### list

```python theme={null}
def list(self) -> list[Project]
```

Lists all projects.

**Raises**

* `errors.UnexpectedStatus`: If the server returns an undocumented status code and Client.raise\_on\_unexpected\_status is True.
* `httpx.TimeoutException`: If the request takes longer than Client.timeout.

**Returns**

* `list[Project]`: A list of projects.

## create\_project

```python theme={null}
def create_project(name: str) -> Project
```

Creates a new project.

**Arguments**

* `name` (`str`): The name of the project.
* `type_` (`ProjectType`): The type of the project.

**Raises**

* `errors.UnexpectedStatus`: If the server returns an undocumented status code and Client.raise\_on\_unexpected\_status is True.
* `httpx.TimeoutException`: If the request takes longer than Client.timeout.

**Returns**

* `Project`: The created project.

## delete\_project

```python theme={null}
def delete_project(*, id: Optional[str]=None, name: Optional[str]=None) -> bool
```

Deletes a gen\_ai project by ID or name (exactly one of `id` or `name` must be provided).

**Arguments**

* `id` (`str`): The ID of the project to delete.
* `name` (`str`): The name of the project to delete.

**Raises**

* `ValueError`: If neither or both `id` and `name` are provided.
* `ProjectsAPIException`: If the server returns an error response or if the project is not a gen\_ai project.
* `errors.UnexpectedStatus`: If the server returns an undocumented status code and Client.raise\_on\_unexpected\_status is True.
* `httpx.TimeoutException`: If the request takes longer than Client.timeout.

**Returns**

* `bool`: True if the project was successfully deleted, False otherwise.

**Examples**

```python theme={null}
delete_project(id="8aed99a3-c678-49a3-80e8-2bf914eda7a5")
delete_project(name="my-project")
```

## get\_project

```python theme={null}
def get_project(*,
                id: Optional[str]=None,
                name: Optional[str]=None) -> Optional[Project]
```

Retrieves a project by id or name (exactly one of `id` or `name` must be provided).

**Arguments**

* `id` (`str`): The id of the project.
* `name` (`str`): The name of the project.
* `with_content` (`bool`): Whether to return the content of the project. Default is False.

**Raises**

* `errors.UnexpectedStatus`: If the server returns an undocumented status code and Client.raise\_on\_unexpected\_status is True.
* `httpx.TimeoutException`: If the request takes longer than Client.timeout.

**Returns**

* `Project`: The project.

## list\_projects

```python theme={null}
def list_projects() -> list[Project]
```

Lists all projects.

**Arguments**

* `limit` (`Union[Unset, int]`): The maximum number of projects to return. Default is 100.

**Raises**

* `errors.UnexpectedStatus`: If the server returns an undocumented status code and Client.raise\_on\_unexpected\_status is True.
* `httpx.TimeoutException`: If the request takes longer than Client.timeout.

**Returns**

* `list[Project]`: A list of projects.

## list\_user\_project\_collaborators

```python theme={null}
def list_user_project_collaborators(project_id: str) -> list[UserCollaborator]
```

List all users that a project is shared with.

**Arguments**

* `project_id` (`str`): The ID of the project.

**Returns**

* `List[UserCollaborator]`: A list of users that the project is shared with.

## share\_project\_with\_user

```python theme={null}
def share_project_with_user(project_id: str,
                            user_id: str,
                            role: CollaboratorRole=CollaboratorRole.VIEWER) -> UserCollaborator
```

Share a project with a user.

**Arguments**

* `project_id` (`str`): The ID of the project.
* `user_id` (`str`): The ID of the user.
* `role` (`CollaboratorRole`): The role to assign to the user.

**Returns**

* `UserCollaborator`: The created user collaborator object.

## unshare\_project\_with\_user

```python theme={null}
def unshare_project_with_user(project_id: str, user_id: str) -> None
```

Unshare a project with a user.

**Arguments**

* `project_id` (`str`): The ID of the project.
* `user_id` (`str`): The ID of the user.

## update\_user\_project\_collaborator

```python theme={null}
def update_user_project_collaborator(project_id: str,
                                     user_id: str,
                                     role: CollaboratorRole=CollaboratorRole.VIEWER) -> UserCollaborator
```

Update a user's role for a project.

**Arguments**

* `project_id` (`str`): The ID of the project.
* `user_id` (`str`): The ID of the user.
* `role` (`CollaboratorRole`): The new role to assign to the user.

**Returns**

* `UserCollaborator`: The updated user collaborator object.
