Getting all data from a stream/commit

Hi all!

I hope you’re "speckle"ing well :v: I’m here to consult your expertise again :blush:

I’m currently using Python SDK to receive data from Speckle. Once I have the collection, I loop through it and create the material table/takeoff and, unsurprisingly, I get errors for some fields. And I know this is not a viable solution for performance etc. What I want to achieve is to get all the data into a JSON file and experiment on it for now. My ultimate goal is to automatically create this table without asking the user for any objects or fields.

Regardless of language/SDK, what would be the best approach to interacting with Speckle from this perspective? If you have any suggestions for documents, topics, etc. that you think I can look at, I would be happy to hear. Thank you in advance <3

Are you looking for the JSON to be the raw data published to Speckle or formatted according to a schema template you seek to populate?

Actually, first, I’m looking for the JSON to be the raw data published to Speckle. What I want may be strange, I just want to have all the information (for the commit) in a single JSON file and work on it.

I’m also trying to figure out the best way to create table for all elements (walls, floors, etc.) without worrying about fields in different models. However, it is difficult for me to scale this without fully understanding the objects and their fields and without being able to solve the structure. So, I’m seeking for docs or examples :sweat_smile: I’m currently reading this: A Simple Web Based Table View for Speckle Data

I hope I explained myself clearly, thank you for your understanding. :upside_down_face:

Straightforwardly, you can retrieve the resolved json for a version using the endpoint

https://<host>/objects/<streamid>/<objectid>

so as an example of that - and its a massive blob of json:

https://app.speckle.systems/objects/35ad6a0c9c/11744f01cf2454d92e880024db6fe281

Which may not be the best for you.

Depending on where the data has come from - I presume ArchiCAD, IFC or Revit, it may be preferable to make a GraphQL query to limit the data returned to the objects and their properties.

This seems likely if you are building a web application with no 3d viewer.

See if this makes sense for you:

1 Like

Hi @jonathon,

Yes, it makes sense. Thank you for sharing the resource and your knowledge :pray: My path is clearer now :v:

1 Like