How to beginner · 3 min read

How to manage wandb projects

Quick answer
Use the wandb Python SDK to create and manage projects by initializing runs with specific project names. Organize experiments by grouping runs under these projects and use the wandb.Api() to list, update, or delete projects programmatically.

PREREQUISITES

  • Python 3.8+
  • pip install wandb
  • wandb account (free tier available)
  • wandb login or set WANDB_API_KEY environment variable

Setup

Install the wandb Python package and authenticate your account to start managing projects.

bash
pip install wandb
wandb login

Step by step

This example shows how to create a new project by initializing a run with a project name, log metrics, and then use the wandb.Api() to list all projects in your account.

python
import os
import wandb

# Initialize a new run in a specific project
run = wandb.init(project="my-sample-project", entity="your-wandb-username")

# Log some metrics
for epoch in range(3):
    wandb.log({"epoch": epoch, "accuracy": 0.8 + epoch * 0.05})

run.finish()

# Use wandb API to list projects
api = wandb.Api()
projects = api.projects(entity="your-wandb-username")
print("Projects in your account:")
for project in projects:
    print(f"- {project.name} (id: {project.id})")
output
Projects in your account:
- my-sample-project (id: 1234567)
- another-project (id: 7654321)

Common variations

You can manage projects asynchronously or use the wandb.Api() to update project descriptions or delete projects. Also, you can organize runs by tags or groups within projects for better experiment management.

python
import wandb

api = wandb.Api()

# Update project description
project = api.project(entity="your-wandb-username", project="my-sample-project")
project.update(description="Updated project description for clarity.")

# Delete a project (use with caution)
# api.delete_project(entity="your-wandb-username", project="my-sample-project")

Troubleshooting

  • If you see authentication errors, ensure your WANDB_API_KEY is set correctly or run wandb login.
  • If projects do not appear, verify the entity parameter matches your wandb username or team name.
  • For permission issues, check your wandb account roles and access rights.

Key Takeaways

  • Use wandb.init(project=...) to create and organize runs under projects.
  • Leverage wandb.Api() to programmatically list, update, or delete projects.
  • Always authenticate properly with wandb login or WANDB_API_KEY environment variable.
  • Organize experiments further with tags and groups inside projects for clarity.
  • Check entity names carefully to avoid missing projects or permission errors.
Verified 2026-04
Verify ↗