Data visualisation using python

How can i use google data visualisation library(or any library) in my python code?i want to create visualised data on the bolt cloud that can be accessed from the bolt app
can i deploy configuration and run a python code (in terminal) together for the same wifi module
@vinayak.joshi,@rahul.singh1 please help me on this it is urgent,

thank you

@deepa90prasad The visualization library is limited to the Bolt Cloud. You cannot use the Bolt visualization library which is based on Javascript in your Python code.
You will need to download the data via API calls and then draw it on the terminal. I think this link will be helpful for you to visualize data on Python.

Yes, you can deploy configuration and also run the Python code on terminal at the same time.

1 Like

@shoeb.ahmed. Can you please share a example code to get data in my python code from bolt cloud in real time please

@deepa90prasad You can use the AnalogRead function to read a data value from the Bolt. This will return the value of the A0 pin and you can use it to plot the data on the graph.
Something like,

import matplotlib.pyplot as plt
import json
import time
# Add other imports    

timestamps = []
values = []
while True:
    time.sleep(10)
    timestamp = datetime.utcnow().strftime("%c")
    response = json.loads(bolt.analogRead("A0"))
    if not response["status"]:
        continue
    value = response["value"]
    timestamps.append(timestamp)
    values.append(value)
    plt.plot(timestamps, values)
    plt.show()

Please note that this is just sample code to visualize what can be done. It may or may not work.

1 Like