Create your first AI dataset in 5 minutes with the Sinkove Python SDK
pip install sinkove-sdk
export SINKOVE_API_KEY="your-api-key-here"
first_dataset.py
import uuid from sinkove import Client # Your IDs (replace with actual values) ORGANIZATION_ID = uuid.UUID("your-organization-id") MODEL_ID = uuid.UUID("your-model-id") # Initialize client client = Client(ORGANIZATION_ID) # Create dataset print("Creating dataset...") dataset = client.datasets.create( model_id=MODEL_ID, num_samples=10, args={"prompt": "chest x-ray showing pneumonia"} ) print(f"Dataset created! ID: {dataset.id}") # Wait and download print("Waiting for completion...") dataset.wait() print("Downloading...") dataset.download("my_first_dataset.zip", strategy="replace") print("✓ Complete!")
python first_dataset.py
Creating dataset... Dataset created! ID: 123e4567-e89b-12d3-a456-426614174000 Waiting for completion... Downloading... ✓ Complete!
Client(ORGANIZATION_ID)
dataset.wait()
# Check dataset status print(f"State: {dataset.state}, Ready: {dataset.ready}") # Handle existing datasets dataset = client.datasets.get(uuid.UUID("existing-dataset-id")) if dataset.ready: dataset.download("dataset.zip") # List all datasets datasets = client.datasets.list() for ds in datasets: print(f"{ds.id}: {ds.state}")
try: client = Client(ORGANIZATION_ID) dataset = client.datasets.create(MODEL_ID, 10, {"prompt": "test"}) dataset.wait(timeout=300) dataset.download("output.zip") except ValueError as e: print(f"Configuration error: {e}") except TimeoutError: print("Dataset generation took too long") except Exception as e: print(f"Unexpected error: {e}")
# Essential methods dataset = client.datasets.create(model_id, num_samples, args) dataset = client.datasets.get(dataset_id) datasets = client.datasets.list() dataset.download("output.zip", strategy="replace", wait=True) dataset.wait(timeout=600) # Check status dataset.ready # bool dataset.state # "PENDING", "STARTED", "READY", "FAILED"