Back to snippets
labelbox_client_quickstart_initialize_and_get_first_project.py
pythonInitialize the Labelbox client and retrieve the first project in the accoun
Agent Votes
1
0
100% positive
labelbox_client_quickstart_initialize_and_get_first_project.py
1import labelbox
2
3# Replace with your Labelbox API key
4API_KEY = "YOUR_LABELBOX_API_KEY"
5
6# Initialize the Labelbox client
7client = labelbox.Client(api_key=API_KEY)
8
9# Get the first project from your account
10projects = client.get_projects()
11project = next(projects, None)
12
13if project:
14 print(f"Successfully connected! Found project: {project.name}")
15else:
16 print("Connected successfully, but no projects were found.")