Skip to main content

Project Management Guide

This guide covers how to manage your Voyager projects programmatically, including creating projects, organizing them, and managing their lifecycle.

Overview

Projects are containers for CT scan data, analyses, and results. The API provides comprehensive endpoints for managing projects throughout their lifecycle.

Creating Projects

Basic Project Creation

  • Python
  • curl
from api_client import LumafieldAPIClient

client = LumafieldAPIClient(api_url, email, password)

# Create a new project
project = client.create_project(
    workspace_id="your-workspace-uuid",
    name="My New Project"
)

print(f"Created project: {project['name']} (ID: {project['id']})")

Listing Projects

Basic Listing

  • Python
# List all projects
projects = client.list_projects()
print(f"Found {projects['count']} projects")

for project in projects['results']:
    print(f"  • {project['name']} - {project['status']}")

Filtering Projects

  • Python
# Filter by state
active_projects = client.list_projects(state="active")

# Filter by workspace
workspace_projects = client.list_projects(workspace="workspace-uuid")

# Filter by tag
tagged_projects = client.list_projects(tag="production")

# Search by name
search_results = client.list_projects(search="widget")

# Combine filters
filtered = client.list_projects(
    state="active",
    workspace="workspace-uuid",
    tag="q1-2024"
)

Getting Project Details

  • Python
project_id = "your-project-uuid"
project = client.get_project(project_id)

print(f"Name: {project['name']}")
print(f"Status: {project['status']}")
print(f"Created: {project['created_at']}")
print(f"Workspace: {project['workspace']['name']}")

Updating Projects

  • Python
# Update project name
updated = client.update_project(
    id=project_id,
    name="Updated Project Name"
)

# Partial update
patched = client.patch_project(
    id=project_id,
    name="Patched Name"
)

Project Lifecycle Management

Archiving Projects

  • Python
# Archive a project
client.archive_project(project_id)

# List archived projects
archived = client.list_projects(state="archived")

# Restore archived project
client.restore_project(project_id)

Copying Projects

  • Python
# Copy project to another workspace
copied = client.copy_project(
    id=project_id,
    destination_workspace_id="destination-workspace-uuid",
    name="Copy of Original Project"
)

Moving Projects

  • Python
# Move project between workspaces
moved = client.move_project(
    id=project_id,
    destination_workspace_id="destination-workspace-uuid"
)

Deleting Projects

  • Python
# Delete a project (permanent)
success = client.delete_project(project_id)
if success:
    print("Project deleted")

Working with Project Tags

  • Python
# Get project tags
tags = client.get_project_tags(project_id)

# Tags are typically managed through project updates
# or bulk operations

Getting Project Data

Project Parts

  • Python
# Get all parts in a project
parts = client.get_project_parts(project_id)
print(f"Project has {len(parts['results'])} parts")

Project Bookmarks

  • Python
# Get all bookmarks in a project
bookmarks = client.get_project_bookmarks(project_id)
print(f"Project has {len(bookmarks['results'])} bookmarks")

Best Practices

1. Use Pagination

Always handle pagination when listing projects:
projects = client.list_projects(get_all_pages=True)  # Gets all pages
# or
first_page = client.list_projects(page_size=10, get_all_pages=False)

2. Filter Before Processing

Use API filters instead of filtering in your code:
# ✅ Good - filter at API level
active_projects = client.list_projects(state="active")

# ❌ Less efficient - filter in code
all_projects = client.list_projects()
active = [p for p in all_projects['results'] if p['status'] == 'active']

3. Handle Errors Gracefully

try:
    project = client.get_project(project_id)
except requests.exceptions.HTTPError as e:
    if e.response.status_code == 404:
        print("Project not found")
    else:
        raise

Next Steps