I’m trying to pass a simple integer from dynamo and pull that number into Python. However, when I read the objects passed through, I only get data in the form of:
I’m quite new to speckle and python in general so I’m struggling to understand the GitHub material in terms of the correct way to extrapolate the integer data that is being passed by dynamo.
Here’s the code, it’s from the PySpeckle intro. The data in my stream is essentially a singular number. I want to understand the premise before I complicate my data further. I have the correct login and stream info in my code.
# Create a client using the appropriate server
client = SpeckleApiClient('hestia.speckle.works')
# Login with your details
client.login(
email='XXXXX',
password='XXXXX'
)
# Stream ID to get
stream_id = 'XXXXX'
# Get stream data using its ID
stream = client.streams.get(stream_id)
# Print out some object info
for object in stream.objects:
print(object)
I’m afraid that’s code for Speckle v1! We’re not actively supporting v1 connectors, but I’ll ping the author in case he’s around and has time to help @TomSvilans
If you’re curious about v2, here’s the repo (in alpha stage currently).
In Speckle 1.0, the objects you receive back from a stream are all Placeholder objects. You then need to get the actual object data using the id of Placeholder objects you retrieve from the streams.
This is done with something like: obj = client.objects.get(<id_from_placeholder>)
I copied the code and inputted the ID number to no avail.
Code:
# Get stream data using its ID
stream = client.streams.get(stream_id)
# Print out some object info
obj = client.objects.get('5eda6faca9cfd20ce6d8ecfa')
print(obj)