Get dynamically generated data

What is the best way of getting dynamically generated data?

Lets say, we have an app in Flask where the user can upload some data, then we store the data in some persistent place, e.g., database or a file. How can I retrieve that data and plot it? o How can I tell Dash which data to read?


You can read files in Python in a variety of ways. In the examples, I use the pandas library with df = pd.read_csv('the-name-of-your-file.csv') to read CSVs. You can also use that library to query databases: df = pd.read_sql('SELECT * FROM my_database LIMIT 10', connection).

1 Like

For dynamically generated data, you can make sure that your app reads the latest data on every page load by setting app.layout as a function, see Live Updates | Dash for Python Documentation | Plotly

1 Like

Hi, Chriddyp,
I just surfed your reply of the questions. I also have a similar problems. if I dynamically generated data, I need to refresh the page to displayed the updated information. right? If so, how can I trigger this update in plotly dash? in my case, I the dynamically generated data is based on an input from a component of Input. and the data needs to be used by a dropdown list in the same web page. do you think it is possible to realize?
thanks in advance.