I'm currently experiencing an issue parsing data received from SkySpark using the pyhaystack library. Could you please assist me in figuring out how to convert this data into JSON?
I'm specifically interested in extracting the "schedule" and "siteRef" from this Zinc-formatted data. I've attempted various methods such as using hszinc.parse, but none have been successful.
Thank you for your assistance.
Rafay AhmedThu 7 Dec 2023
Currently, I've implemented a temporary solution by custom parsing as follows:
def getScheduleData(zinc_data):
result = []
start_index = zinc_data.find("<<")
end_index = zinc_data.find(">>")
if start_index > -1 and end_index > -1:
zinc_data = zinc_data[start_index:end_index]
lines = zinc_data.split("\n", 1)
zinc_data = lines[1]
zinc_data = hszinc.parse(zinc_data)
for row in zinc_data:
dictObject = dataDictionary()
for val in row:
dictObject.add(val, str(row[val]))
result.append(dictObject)
return result
However, a more robust solution would be appreciated if anyone could provide assistance.
Rafay Ahmed Wed 6 Dec 2023
Hello,
I'm currently experiencing an issue parsing data received from SkySpark using the pyhaystack library. Could you please assist me in figuring out how to convert this data into JSON?
Here's an example of the data:
I'm specifically interested in extracting the "schedule" and "siteRef" from this Zinc-formatted data. I've attempted various methods such as using hszinc.parse, but none have been successful.
Thank you for your assistance.
Rafay Ahmed Thu 7 Dec 2023
Currently, I've implemented a temporary solution by custom parsing as follows:
def getScheduleData(zinc_data):
However, a more robust solution would be appreciated if anyone could provide assistance.
Thank you.