right now I have a python script where I use the request library to fetch some data from an URL, the response is JSOn data and I put that into a pandas dataframe and then to csv. There is some input needed, start and end date and sensor name.
Know I want to have some user interface where I can have a list with the sensors and a date picker where I can select the start and end date. After I entered them I will hit a „download“ button and have the data fetched from the URL and saved it to csv and show a summary on the page.
My question, is that possible with dash? Datepicker is what I already saw, but how would I connect a button to fire up the request to fetch the data from the url?
Would appreciate in what direction I have to look and use.
What I can‘t grasp my head on is the interface. Say I have the date picker on the page and I select the dates. What is next? What component do I need to fire up the request? Maybe it is simple and yet I can‘t see it.
It seems to be more complex than I thought. I need at least three seperate callbacks as far as I can see. One for date input where I also have some logic for the initial data, one for the URL request+data storage which I can trigger. And the third one for the graph generation.
How do the callbacks work, when I fire up the dash server does it immediately try to do a request or does it wait to select a date?
All callbacks, when first loaded will try to fire, this can cause quite a bit of requests to go to the server upon the client loading. However, for each callback that you do not want to fire, you can pass prevent_initial_call=True to disable this feature.
As far as the callbacks, I am thinking you’ll only need to use one as far as I can tell.
You can read hear to find out more about callbacks, then once you are comfortable you can expand into more advanced callbacks as you need.