Sign in Get started

Connectors

Migrate datasets from V7 (Darwin) and Roboflow into Pictograph: images, classes and annotations come across, converted to Pictograph JSON automatically.

View as Markdown
On this page

Validate the source key, then import. The key (a V7 token or a Roboflow key) is sent with each call and never stored; in the CLI, set PICTOGRAPH_SOURCE_KEY rather than passing --key, which shell history keeps.

Supported providers

provider Source Brings in Folders
v7 V7 Darwin Boxes, polygons, polylines, keypoints and image tags Kept
roboflow Roboflow Boxes, polygons and keypoints, from its COCO export None; images land at the root

validate

Check the source key and list the datasets it can read.

Source: Connectors.validate

Arg Type Default Notes
provider ConnectorProvider required "v7" or "roboflow"
api_key str required Source provider’s API key
result = client.connectors.validate(
    provider="v7",
    api_key="v7_api_token_example",
)
if result.valid:
    for ds in result.datasets:
        print(ds.id, ds.name, ds.image_count)
else:
    print("invalid:", result.error)
export PICTOGRAPH_SOURCE_KEY=v7_api_token_example
pictograph connectors validate v7
curl -s -X POST "https://api.pictograph.io/api/v1/developer/connectors/validate" \
  -H "X-API-Key: $PICTOGRAPH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"provider": "v7", "api_key": "v7_api_token_example"}'

Returns ValidationResult

ValidationResult · 4 fields
class ValidationResult(BaseModel):
    """Outcome of Connectors.validate."""
    valid: bool
    workspace: str = ''
    datasets: list[RemoteDataset] = []
    error: str | None = None

check_limits

Whether an import fits your plan’s image and storage limits, before you start it.

Source: Connectors.check_limits

Arg Type Default Notes
total_images int required Images about to be imported
estimated_size_bytes int required Estimated total import size, in bytes
check = client.connectors.check_limits(
    total_images=12500,
    estimated_size_bytes=4_000_000_000,
)
if not check.allowed:
    print("blocked by:", check.exceeded)
pictograph connectors check-limits --images 12500 --bytes 4000000000
curl -s -X POST "https://api.pictograph.io/api/v1/developer/connectors/check-limits" \
  -H "X-API-Key: $PICTOGRAPH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"total_images": 12500, "estimated_size_bytes": 4000000000}'

Returns LimitCheckResult

LimitCheckResult · 8 fields
class LimitCheckResult(BaseModel):
    """Outcome of Connectors.check_limits."""
    allowed: bool
    current_images: int
    image_limit: int
    images_after_import: int
    current_storage_bytes: int
    storage_limit_bytes: int
    storage_after_import_bytes: int
    exceeded: Optional[Literal['images', 'storage', 'both']] = None

import_

Import datasets, each into a new dataset of its name ( (2) is appended if the name is taken).

Source: Connectors.import_

Arg Type Default Notes
provider ConnectorProvider required "v7" or "roboflow"
api_key str required Source provider’s API key
datasets Sequence[RemoteDataset | dict[str, Any]] required Rows from validate (RemoteDataset models or dicts)
wait bool True Wait until the import finishes
poll_interval float 3.0 Seconds between checks
timeout float 3600.0 Max seconds to wait; large V7 imports can take 30+ minutes
job = client.connectors.import_(
    provider="v7",
    api_key="v7_api_token_example",
    datasets=[
        {"id": "ds_abc", "name": "Road signs", "slug": "road-signs"},
    ],
    wait=True,
    poll_interval=3.0,
    timeout=3600.0,
)
print(job.import_id, job.status)
for ds in job.datasets:
    print(ds.name, ds.imported, "/", job.total_images)
export PICTOGRAPH_SOURCE_KEY=v7_api_token_example

# --dataset is repeatable and resolves ids against `connectors validate`.
pictograph connectors import v7 --dataset ds_abc --dataset ds_def

# Return as soon as the job is queued instead of waiting for it.
pictograph connectors import v7 --dataset ds_abc --no-wait
curl -s -X POST "https://api.pictograph.io/api/v1/developer/connectors/import/start" \
  -H "X-API-Key: $PICTOGRAPH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "v7",
    "api_key": "v7_api_token_example",
    "datasets": [
      {"id": "ds_abc", "name": "Road signs", "slug": "road-signs"}
    ]
  }'

Returns ImportJob

ImportJob · 8 fields
class ImportJob(BaseModel):
    """Snapshot of an import operation - totals + per-dataset breakdown."""
    import_id: str
    status: Literal['processing', 'completed', 'error', 'cancelled']
    progress: float = 0.0
    total_images: int = 0
    imported_images: int = 0
    failed_images: int = 0
    current_dataset: str = ''
    datasets: list[DatasetImportProgress] = []

get_import

An import’s current state.

Source: Connectors.get_import

Arg Type Default Notes
job str required Job id
job = client.connectors.get_import(job="imp_7f31a904")
print(job.status, job.progress, job.imported_images)
pictograph connectors status imp_7f31a904
curl -s "https://api.pictograph.io/api/v1/developer/connectors/import/status/imp_7f31a904" \
  -H "X-API-Key: $PICTOGRAPH_API_KEY"

Returns ImportJob

ImportJob · 8 fields
class ImportJob(BaseModel):
    """Snapshot of an import operation - totals + per-dataset breakdown."""
    import_id: str
    status: Literal['processing', 'completed', 'error', 'cancelled']
    progress: float = 0.0
    total_images: int = 0
    imported_images: int = 0
    failed_images: int = 0
    current_dataset: str = ''
    datasets: list[DatasetImportProgress] = []

wait_for_import

Wait for an import to finish.

Source: Connectors.wait_for_import

Arg Type Default Notes
job str required Job id
poll_interval float 3.0 Seconds between checks
timeout float 3600.0 Max seconds to wait
job = client.connectors.wait_for_import(
    job="imp_7f31a904",
    timeout=600.0,
)
print(job.status)
# No wait command - `connectors import` already blocks unless you pass
# --no-wait. Otherwise poll status until it reports a terminal state.
pictograph connectors status imp_7f31a904
# No wait endpoint - poll this one until status is completed, error or cancelled.
curl -s "https://api.pictograph.io/api/v1/developer/connectors/import/status/imp_7f31a904" \
  -H "X-API-Key: $PICTOGRAPH_API_KEY"

Returns ImportJob

ImportJob · 8 fields
class ImportJob(BaseModel):
    """Snapshot of an import operation - totals + per-dataset breakdown."""
    import_id: str
    status: Literal['processing', 'completed', 'error', 'cancelled']
    progress: float = 0.0
    total_images: int = 0
    imported_images: int = 0
    failed_images: int = 0
    current_dataset: str = ''
    datasets: list[DatasetImportProgress] = []

cancel_import

Cancel a running import; the images already imported stay.

Source: Connectors.cancel_import

Arg Type Default Notes
job str required Job id
job = client.connectors.cancel_import(job="imp_7f31a904")
print(job.status)
pictograph connectors cancel imp_7f31a904 --yes
curl -s -X POST "https://api.pictograph.io/api/v1/developer/connectors/import/cancel/imp_7f31a904" \
  -H "X-API-Key: $PICTOGRAPH_API_KEY"

Returns ImportJob

ImportJob · 8 fields
class ImportJob(BaseModel):
    """Snapshot of an import operation - totals + per-dataset breakdown."""
    import_id: str
    status: Literal['processing', 'completed', 'error', 'cancelled']
    progress: float = 0.0
    total_images: int = 0
    imported_images: int = 0
    failed_images: int = 0
    current_dataset: str = ''
    datasets: list[DatasetImportProgress] = []

Annotation conversion

V7 / COCO Pictograph
V7 polygon.paths polygon.paths (unchanged)
V7 bounding_box (no polygon) bounding_box
V7 line.path polyline.path
V7 keypoint keypoint
V7 tag An image tag and a tag class
V7 ellipse / mask / cuboid / raster_layer Skipped (no equivalent)
COCO segmentation (flat array) polygon.paths
COCO bbox (no segmentation) bounding_box
COCO keypoints triplets keypoint (points with v=0 skipped)

A class with no source color gets an unused palette color.

Common errors

Status Exception Cause
401 AuthError The source provider rejected the key
402 PaymentRequiredError The import exceeds your plan’s limits
403 ForbiddenError A key below member (import_, cancel_import)
404 NotFoundError The import job doesn’t exist
422 ValidationError An unknown provider, or an empty datasets list
- PollTimeoutError The wait passed timeout; the import keeps running
Copied to clipboard