Sending numbers as speckle objects

Hi everyone,

I have some numbers of carbon data that I have compiled in grasshopper along with their category names. If I send these numbers as detached objects to a stream, how would I receive these numbers in a specklepy/streamlit website so I can make a graph. I had a look at the sending and receiving docs for specklepy but it’s a bit confusing.

It’s as simple as sending [‘wall’: 1, ‘floor’: 10, ‘roof’: 5] and then getting back those numbers inside python as variables.


1 Like

Hey @Rivindu_Bandara ,

It is not that hard actually. Only catch is if an object is detached, it has an additional “@” as a prefix. For instance:
You send “Wall” as a detached object and it’s value is “1”. You can access it as:

grasshopper_data = received_obj["@Data"]["@{0}"][0]["@Wall"]

You can check if its detached by hovering over the key in the web ui.


I’d advise you to not detach objects if they are simple strings/numbers and not big, repetitive geometries. So accessing your value would look like:

grasshopper_data = received_obj["@Data"]["@{0}"][0]["Wall"]

We have an examples repository for working with Grasshopper data inside python. Take a look and feel free to ping us if you have any questions:


As a nerdy side note, we don’t detach primitive types anyway (numbers of all kinds, strings, etc), even if the property is flagged as detachable.