To get started, navigate to the OcularAI Foundry platform, select the required version to incorporate in your work environment.main version page to show user how to create a export from a version
Click on the create export button and navigate to the previous exports tab to select the required export.create export page to show user how he can create a exportYou’ll get a customized snippet that you can use to download the dataset.
Configure your API key from OcularAI Foundry platform by navigating to:Workspace settings / developers console / API keys
API keys page to show , how to create a api key
Here’s a simple example of how to download a dataset using the SDK:
Copy
Ask AI
from ocular import Ocular# Initialize the SDK with your API keyocu = Ocular(api_key="YOUR_API_KEY")# Access your workspace and projectproject = ocu.workspace("WORKSPACE_ID").project("PROJECT_ID")# Get a specific versionversion = project.version("VERSION_ID")# Get an export and download the datasetexport = version.export("EXPORT_ID")dataset = export.download()# The dataset variable contains the path to the downloaded datasetprint(f"Dataset downloaded to: {dataset}")
You can find the specific IDs for your workspace, project, version, and export in the OcularAI Foundry platform.
Replace {version_id} and {export_id} with your specific IDs.
Store your API key in environment variables to avoid hardcoding it in your scripts. The SDK will automatically look for the OCULAR_API_KEY environment variable.