The Python SDK allows you to access all of the functionalities of the Labelbox API without having to use GraphQL.
Create your API key in the Account section in your Labelbox account.
Save your API key somewhere as it will be hidden afterward.
To install, run
pip install labelbox in your command line.
There are 3 ways to set up authentication with Labelbox.
Pass your API key as an environment variable in the command line.
Then, import and initialize the API Client.
from labelbox import Client client = Client()
Pass a custom endpoint. This is only applicable for on-premises use cases. If this applies to you, you may pass the API key and server endpoint explicitly when you initialize the Client object. Otherwise, refer to Option 1.
from labelbox import Client client = Client("<your_api_key_here>", "https://app.your-domain.com/api/graphql")
Run this Python script and pass your API key as a string.
from labelbox import Client if __name__ == '__main__': API_KEY = "<your_api_key_here>" client = Client(API_KEY)