Skip to main content
This workflow shows how to use SpecklePy with Speckle Server model datasets for analytics use cases.
This notebook currently targets Revit-oriented analytics paths (for example category and proxy.level examples in EAV queries). It expects versions published from Speckle Connectors >3.20.
You will:
  1. Resolve a model version with SpecklePy.
  2. Check whether analytics datasets are available for that version.
  3. Download both artifacts from server endpoints.
  4. Query them locally with DuckDB.

Why this workflow

For analytics, this path is usually faster and more repeatable than traversing the full object graph:
  • The main dataset (.duckdb) provides objects and root tables.
  • The EAV dataset (.eav.duckdb) provides query-ready properties and proxies tables.

Prerequisites

  • Python 3.10+
  • Personal access token with project read access
  • A version published from Speckle Connectors >3.20
  • A model URL (recommended), or projectId + modelId (version optional)
  • Packages:
Create a .env file in your working folder:
The tutorial assumes credentials and IDs come from environment variables rather than hardcoded values. If you need to create a token first, use Building with PATs.
Older published versions created before automatic dataset generation may return availability or download errors. In that case, run this tutorial on a newer published version.

Endpoint shape

Given projectId, modelId, versionId, the server exposes:
  • Main dataset: /api/v1/projects/{projectId}/models/{modelId}/versions/{versionId}/download
  • EAV dataset: /api/v1/projects/{projectId}/models/{modelId}/versions/{versionId}/eav/download
Both require auth (Bearer token or share token headers).

Step-by-step tutorial

1) Authenticate with SpecklePy

2) Resolve IDs with minimal input and check dataset availability

objectKey is the server-side signal that a version has a generated primary dataset.

3) Download datasets

4) Query with DuckDB

5) Optional EAV analytics queries

Notebook

Download the notebook. Save it locally, add your .env in the same folder, and run top to bottom.

Troubleshooting

Check projectId, modelId, and versionId first. Then confirm the version has objectKey in GraphQL metadata.
Some historical versions were published before dataset auto-generation was enabled. Those versions can return availability or download errors for this workflow. Use a newer published version where datasets are generated.
Verify token scope and project access. Use a PAT with read access to that project.
The version may not have completed EAV extraction yet. Retry later, or use only the main dataset until EAV is ready.
Last modified on July 18, 2026