Back to Templates

Streaming database updates

View App View Code on GitHub
shiny create --template monitor-database --mode core --github posit-dev/py-shiny-templates

Efficiently monitor a database for updates and visualize the data in real-time. In this case, we’re monitoring an SQLite database with simulated model accuracy data, but the core logic can easily adapt to other databases and use cases. Note also that this template has:

  • A switch input to toggle the data update on and off (thanks to reactive isolation, this is easy!).
  • A dynamically updating plot and value box icons (when model accuracy gets above/below a certain threshold).
    • And this all happens without any layout shifts!

Packages:

  • faicons
  • numpy
  • pandas
  • plotly
  • shinywidgets
  • sqlite3