How can I get all properties of models in my project?

  • Objective: How can I get all properties of models in my project?

  • Issue: We have been working on retrieving all the model properties in our Speckle project. But the API documentation seems to be outdated. i.e. it is using outdated structure: Stream/Branch/Commit. Below is our best code that can retrieve the our project. And please give us the related API documentation for our project.

  • Example:

from specklepy.api import operations
from specklepy.api.client import SpeckleClient
from specklepy.api.credentials import get_default_account
from specklepy.transports.server import ServerTransport

HOST = "https://app.speckle.systems"
project_ID = "4883debf3f"
MODEL_ID = "fdd831784b"




# create and authenticate a client
client = SpeckleClient(host=HOST)
account = get_default_account()
client.authenticate_with_account(account)

project = client.project.get(project_ID)

print("debug")

Almost there. You can skip the project part and grab the model directly if you have the id.

client = SpeckleClient()
model = client.model.get(model_id, project_id)
print(f"{model.name}-{model.id}\n{model.description}")